X-Git-Url: https://feistymeow.org/gitweb/?p=feisty_meow.git;a=blobdiff_plain;f=nucleus%2Flibrary%2Fbasis%2Fenvironment.cpp;fp=nucleus%2Flibrary%2Fbasis%2Fenvironment.cpp;h=8549ab7a8ea95cc66843e4ec7d5ee293425b28b8;hp=50d7042f9f7ea106ba7322f57e2347d53dac2a13;hb=de0da7f2f7958d4ba652ff2ef5c79991700141ac;hpb=a4c99c6006b3aa20b5f65f02c2d30db7e790083a diff --git a/nucleus/library/basis/environment.cpp b/nucleus/library/basis/environment.cpp index 50d7042f..8549ab7a 100644 --- a/nucleus/library/basis/environment.cpp +++ b/nucleus/library/basis/environment.cpp @@ -17,10 +17,11 @@ #include #include -#ifndef _MSC_VER +//#ifndef _MSC_VER #include #include -#endif +//#endif +/* #ifdef _MSC_VER #define _WINSOCKAPI_ // make windows.h happy about winsock. // winsock support... @@ -31,6 +32,7 @@ #include #include #endif +*/ namespace basis { @@ -54,13 +56,13 @@ astring environment::TMP() astring environment::get(const astring &variable_name) { -#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 +//#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 char *value = getenv(variable_name.observe()); // reasonable OSes support mixed-case environment variables. -#endif +//#endif astring to_return; if (value) to_return = astring(value); @@ -70,20 +72,20 @@ astring environment::get(const astring &variable_name) bool environment::set(const astring &variable_name, const astring &value) { int ret = 0; -#ifdef _MSC_VER - astring assignment = variable_name + "=" + value; - ret = _putenv(assignment.s()); -#else +//#ifdef _MSC_VER +// astring assignment = variable_name + "=" + value; +// ret = _putenv(assignment.s()); +//#else ret = setenv(variable_name.s(), value.s(), true); -#endif +//#endif return !ret; } basis::un_int environment::system_uptime() { -#ifdef _MSC_VER - return timeGetTime(); -#else +//#ifdef _MSC_VER +// return timeGetTime(); +//#else static clock_t __ctps = sysconf(_SC_CLK_TCK); // clock ticks per second. static const double __multiplier = 1000.0 / double(__ctps); // the multiplier gives us our full range for the tick counter. @@ -103,7 +105,7 @@ basis::un_int environment::system_uptime() // emulation) and thus it becomes a bug around 49 days and 17 hours into // OS uptime because the value gets stuck at 2^32-1 and never rolls over. return basis::un_int(ticks_up); -#endif +//#endif } } //namespace.