env.AppendUnique(CCFLAGS = ['-g'])
env.AppendUnique(LINKFLAGS = ['-g'])
+if env.get('LOGGING'):
+ env.AppendUnique(CPPDEFINES = ['-DTB_LOG'])
+
if target_os == 'darwin':
sys_root = tc_path + '/Platforms/MacOSX.platform/Developer/SDKs/MacOSX' + sys_version + '.sdk/'
else:
static android_LogPriority LEVEL[] =
{ ANDROID_LOG_DEBUG, ANDROID_LOG_INFO, ANDROID_LOG_WARN, ANDROID_LOG_ERROR, ANDROID_LOG_FATAL};
#endif
-#elif defined __linux__
+#elif defined (__linux__) || defined (__APPLE__)
static const char *LEVEL[] __attribute__ ((unused)) =
{ "DEBUG", "INFO", "WARNING", "ERROR", "FATAL"};
#elif defined ARDUINO
void OICLogShutdown()
{
-#ifdef __linux__
+#if defined(__linux__) || defined(__APPLE__)
if (logCtx && logCtx->destroy)
{
logCtx->destroy(logCtx);
__android_log_write(LEVEL[level], tag, logStr);
#endif
-#elif defined __linux__
+#elif defined __linux__ || defined __APPLE__
if (logCtx && logCtx->write_level)
{
logCtx->write_level(logCtx, LEVEL_XTABLE[level], logStr);
int min = 0;
int sec = 0;
int ms = 0;
-#ifdef _POSIX_TIMERS
+#if defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0
struct timespec when = { 0, 0 };
clockid_t clk = CLOCK_REALTIME;
#ifdef CLOCK_REALTIME_COARSE