Skip to content

Commit

Permalink
More Linux build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
9EOR9 committed Feb 10, 2015
1 parent 327480b commit 6751718
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
16 changes: 15 additions & 1 deletion 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 Expand Up @@ -92,4 +106,4 @@ void ma_debug_print(my_bool ident, char *format, ...);

#endif /* MA_ODBC_DEBUG_ALL */

#endif /* _ma_debug_h_ */
#endif /* _ma_debug_h_ */
4 changes: 4 additions & 0 deletions ma_dsn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6751718

Please sign in to comment.