diff --git a/ma_debug.h b/ma_debug.h index 51c568bd..260b72e9 100644 --- a/ma_debug.h +++ b/ma_debug.h @@ -31,8 +31,13 @@ #define MA_DEBUG_FLAG 4 +#ifndef WIN32 +#include +#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))\ {\ @@ -40,6 +45,15 @@ void ma_debug_print(my_bool ident, char *format, ...); 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))\ @@ -92,4 +106,4 @@ void ma_debug_print(my_bool ident, char *format, ...); #endif /* MA_ODBC_DEBUG_ALL */ -#endif /* _ma_debug_h_ */ \ No newline at end of file +#endif /* _ma_debug_h_ */ diff --git a/ma_dsn.c b/ma_dsn.c index b3877922..4b3656a5 100644 --- a/ma_dsn.c +++ b/ma_dsn.c @@ -323,7 +323,11 @@ SQLSMALLINT MADB_DsnToString(MADB_Dsn *Dsn, char *OutString, SQLSMALLINT OutLeng case DSN_TYPE_INT: if (*(int *)((char *)Dsn + DsnKeys[i].DsnOffset)) { +#ifdef WIN32 _itoa_s(*(int *)((char *)Dsn + DsnKeys[i].DsnOffset), IntVal, 12, 10); +#else + my_itoa(*(int *)((char *)Dsn + DsnKeys[i].DsnOffset), IntVal, 10); +#endif Value= IntVal; } break;