diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/vdcommon.h | 4 | ||||
-rw-r--r-- | common/vdlog.h | 16 |
2 files changed, 6 insertions, 14 deletions
diff --git a/common/vdcommon.h b/common/vdcommon.h index e50f2b0..cc3bd3d 100644 --- a/common/vdcommon.h +++ b/common/vdcommon.h @@ -46,5 +46,9 @@ typedef CRITICAL_SECTION mutex_t; #define swprintf_s(buf, sz, format...) swprintf(buf, format) #endif +#ifdef OLDMSVCRT +#define _ftime_s(timeb) _ftime(timeb) +#endif + #endif diff --git a/common/vdlog.h b/common/vdlog.h index 2ca03f3..6d0413b 100644 --- a/common/vdlog.h +++ b/common/vdlog.h @@ -25,6 +25,8 @@ #include <time.h> #include <sys/timeb.h> +#include "vdcommon.h" + class VDLog { public: ~VDLog(); @@ -57,19 +59,6 @@ static unsigned int log_level = LOG_INFO; printf("%lu::%s::%s,%.3d::%s::" format "\n", GetCurrentThreadId(), type, datetime, ms, \ __FUNCTION__, ## __VA_ARGS__); -#ifdef OLDMSVCRT -#define LOG(type, format, ...) do { \ - if (type >= log_level && type <= LOG_FATAL) { \ - VDLog* log = VDLog::get(); \ - const char *type_as_char[] = { "DEBUG", "INFO", "WARN", "ERROR", "FATAL" }; \ - if (log) { \ - log->PRINT_LINE(type_as_char[type], format, "", 0, ## __VA_ARGS__); \ - } else { \ - PRINT_LINE(type_as_char[type], format, "", 0, ## __VA_ARGS__); \ - } \ - } \ -} while(0) -#else #define LOG(type, format, ...) do { \ if (type >= log_level && type <= LOG_FATAL) { \ VDLog* log = VDLog::get(); \ @@ -87,7 +76,6 @@ static unsigned int log_level = LOG_INFO; } \ } \ } while(0) -#endif #define vd_printf(format, ...) LOG(LOG_INFO, format, ## __VA_ARGS__) |