Skip to content

Commit

Permalink
Merge from 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
9EOR9 committed Feb 11, 2015
2 parents 172020f + 6751718 commit 4dbf2d0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ma_debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,29 @@

#define MA_DEBUG_FLAG 4

#ifndef WIN32
#include <time.h>
#endif

void ma_debug_print(my_bool ident, char *format, ...);

#ifdef WIN32
#define MDBUG_C_ENTER(C,A)\
if ((C) && ((C)->Options & MA_DEBUG_FLAG))\
{\
SYSTEMTIME st;\
GetSystemTime(&st);\
ma_debug_print(0, ">>> %02d:%02d:%02d --- %s (thread: %d) ---", st.wHour, st.wMinute, st.wSecond, A, (C)->mariadb->thread_id);\
}
#else
#define MDBUG_C_ENTER(C,A)\
if ((C) && ((C)->Options & MA_DEBUG_FLAG))\
{\
time_t t = time(NULL);\
struct tm tm = *localtime(&t);\
ma_debug_print(0, ">>> %02d:%02d:%02d --- %s (thread: %d) ---", tm.tm_hour, tm.tm_min, tm.tm_sec, A, (C)->mariadb->thread_id);\
}
#endif

#define MDBUG_C_RETURN(C,A)\
if ((C) && ((C)->Options & MA_DEBUG_FLAG))\
Expand Down

0 comments on commit 4dbf2d0

Please sign in to comment.