Showing the changes to src/core/chuck_errmsg.cpp (1 of 26 files). Show all
Unified · Split
| @@ -38,8 +38,9 @@ · 37 unmodified lines | |||
| 38 | #include <iostream> | 38 | #include <iostream> |
| 39 | #include "chuck_utils.h" | 39 | #include "chuck_utils.h" |
| 40 | #include "chuck_errmsg.h" | 40 | #include "chuck_errmsg.h" |
| 41 | //#include "util_thread.h" | 41 | #ifndef __DISABLE_THREADS__ |
| 42 | 42 | #include "util_thread.h" | |
| 43 | #endif | ||
| 43 | 44 | ||
| 44 | // global | 45 | // global |
| 45 | int EM_tokPos = 0; | 46 | int EM_tokPos = 0; |
| @@ -57,7 +58,9 @@ static size_t g_lasterrorIndex = strlen(g_lasterror); · 11 unmodified lines | |||
| 57 | // log globals | 58 | // log globals |
| 58 | t_CKINT g_loglevel = CK_LOG_CORE; | 59 | t_CKINT g_loglevel = CK_LOG_CORE; |
| 59 | t_CKINT g_logstack = 0; | 60 | t_CKINT g_logstack = 0; |
| 60 | //XMutex g_logmutex; | 61 | #ifndef __DISABLE_THREADS__ |
| 62 | XMutex g_logmutex; | ||
| 63 | #endif | ||
| 61 | 64 | ||
| 62 | // more local globals | 65 | // more local globals |
| 63 | static const size_t g_buffer2_size = 1024; | 66 | static const size_t g_buffer2_size = 1024; |
| @@ -574,7 +577,9 @@ void EM_log( t_CKINT level, const char * message, ... ) · 510 unmodified lines | |||
| 574 | // check level | 577 | // check level |
| 575 | if( level > g_loglevel ) return; | 578 | if( level > g_loglevel ) return; |
| 576 | 579 | ||
| 577 | // g_logmutex.acquire(); | 580 | #ifndef __DISABLE_THREADS__ |
| 581 | g_logmutex.acquire(); | ||
| 582 | #endif | ||
| 578 | CK_FPRINTF_STDERR( "[chuck]:" ); | 583 | CK_FPRINTF_STDERR( "[chuck]:" ); |
| 579 | CK_FPRINTF_STDERR( "(%i:%s): ", level, g_str[level] ); | 584 | CK_FPRINTF_STDERR( "(%i:%s): ", level, g_str[level] ); |
| 580 | 585 | ||
| @@ -588,7 +593,9 @@ void EM_log( t_CKINT level, const char * message, ... ) · 7 unmodified lines | |||
| 588 | 593 | ||
| 589 | CK_FPRINTF_STDERR( "\n" ); | 594 | CK_FPRINTF_STDERR( "\n" ); |
| 590 | CK_FFLUSH_STDERR(); | 595 | CK_FFLUSH_STDERR(); |
| 591 | // g_logmutex.release(); | 596 | #ifndef __DISABLE_THREADS__ |
| 597 | g_logmutex.release(); | ||
| 598 | #endif | ||
| 592 | } | 599 | } |
| 593 | 600 | ||
| 594 | 601 | ||