X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=nucleus%2Flibrary%2Floggers%2Fcritical_events.cpp;h=a3002d130f3834f454500ca4cb3e6990c4738026;hb=1e12ab9c8e262c16b2953c0701424cd5e751f156;hp=ebb60bb8245bca72e984426ee674318020db7d99;hpb=457b128b77b5b4a0b7dd3094de543de2ce1477ad;p=feisty_meow.git diff --git a/nucleus/library/loggers/critical_events.cpp b/nucleus/library/loggers/critical_events.cpp index ebb60bb8..a3002d13 100644 --- a/nucleus/library/loggers/critical_events.cpp +++ b/nucleus/library/loggers/critical_events.cpp @@ -26,7 +26,7 @@ #include #include -#ifdef __UNIX__ +#ifndef _MSC_VER #include #endif @@ -54,9 +54,9 @@ SAFE_STATIC(mutex, __critical_event_dir_lock, ) basis::un_int critical_events::system_error() { -#if defined(__UNIX__) +#if defined(__UNIX__) || defined(__GNU_WINDOWS__) return errno; -#elif defined(__WIN32__) +#elif defined(_MSC_VER) return GetLastError(); #else #pragma error("hmmm: no code for error number for this operating system") @@ -66,13 +66,13 @@ basis::un_int critical_events::system_error() astring critical_events::system_error_text(basis::un_int to_name) { -#if defined(__UNIX__) +#if defined(__UNIX__) || defined(__GNU_WINDOWS__) return strerror(to_name); -#elif defined(__WIN32__) +#elif defined(_MSC_VER) char error_text[1000]; - FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NIL, to_name, + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL_POINTER, to_name, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)error_text, - sizeof(error_text) - 1, NIL); + sizeof(error_text) - 1, NULL_POINTER); astring to_return = error_text; // trim off the ridiculous carriage return they add. while ( (to_return[to_return.end()] == '\r') @@ -141,7 +141,7 @@ void critical_events::alert_message(const char *info, const char *title) to_print += info; program_wide_logger::get().log(to_print, ALWAYS_PRINT); - fflush(NIL); // flush all output streams. + fflush(NULL_POINTER); // flush all output streams. } void critical_events::alert_message(const astring &info) { alert_message(info.s()); }