X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=nucleus%2Flibrary%2Fbasis%2Fenvironment.cpp;h=50d7042f9f7ea106ba7322f57e2347d53dac2a13;hb=3f11b26ebf3d7bf9fb4fb00813034eda0076f8c0;hp=907c8504b809d3421139fa0c582193ab52d7b7c1;hpb=f2cd4d9e0a4c8a6594ce9c438ed7c71cdae6e558;p=feisty_meow.git diff --git a/nucleus/library/basis/environment.cpp b/nucleus/library/basis/environment.cpp index 907c8504..50d7042f 100644 --- a/nucleus/library/basis/environment.cpp +++ b/nucleus/library/basis/environment.cpp @@ -17,12 +17,17 @@ #include #include -#ifdef __UNIX__ +#ifndef _MSC_VER #include #include #endif -#ifdef __WIN32__ +#ifdef _MSC_VER #define _WINSOCKAPI_ // make windows.h happy about winsock. + // winsock support... +// #undef FD_SETSIZE +// #define FD_SETSIZE 1000 + // if you don't set this, you can only select on a default of 64 sockets. + #include #include #include #endif @@ -42,13 +47,14 @@ astring environment::TMP() // most reasonable OSes have a /tmp directory. to_return = "/tmp"; #endif + if (!!to_return) set("TMP", to_return); } return to_return; } astring environment::get(const astring &variable_name) { -#ifdef __WIN32__ +#ifdef _MSC_VER char *value = getenv(variable_name.upper().observe()); // dos & os/2 require upper case for the name, so we just do it that way. #else @@ -64,7 +70,7 @@ astring environment::get(const astring &variable_name) bool environment::set(const astring &variable_name, const astring &value) { int ret = 0; -#ifdef __WIN32__ +#ifdef _MSC_VER astring assignment = variable_name + "=" + value; ret = _putenv(assignment.s()); #else @@ -75,7 +81,7 @@ bool environment::set(const astring &variable_name, const astring &value) basis::un_int environment::system_uptime() { -#ifdef __WIN32__ +#ifdef _MSC_VER return timeGetTime(); #else static clock_t __ctps = sysconf(_SC_CLK_TCK); // clock ticks per second.