X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=ncurses%2Ftrace%2Flib_trace.c;h=a726901d4a3a746a30ea4d3cb741a02a16c08ce3;hb=3a935d9991cdf43ebfa952073c9b555f73a3e011;hp=0dfc5aacac58f5235c06201524c3fae30b134cae;hpb=c04d54322f7835ed42e597967d8fa5471025fcac;p=ncurses.git diff --git a/ncurses/trace/lib_trace.c b/ncurses/trace/lib_trace.c index 0dfc5aac..a726901d 100644 --- a/ncurses/trace/lib_trace.c +++ b/ncurses/trace/lib_trace.c @@ -47,7 +47,7 @@ #include -MODULE_ID("$Id: lib_trace.c,v 1.74 2010/01/16 16:31:38 tom Exp $") +MODULE_ID("$Id: lib_trace.c,v 1.76 2010/12/19 01:21:19 tom Exp $") NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */ @@ -96,7 +96,7 @@ trace(const unsigned int tracelevel) const char *mode = _nc_globals.init_trace ? "ab" : "wb"; if (TracePath[0] == '\0') { - int size = sizeof(TracePath) - 12; + size_t size = sizeof(TracePath) - 12; if (getcwd(TracePath, size) == 0) { perror("curses: Can't get working directory"); exit(EXIT_FAILURE); @@ -122,7 +122,7 @@ trace(const unsigned int tracelevel) */ #if HAVE_SETVBUF /* ANSI */ (void) setvbuf(TraceFP, (char *) 0, _IOLBF, 0); -#elif HAVE_SETBUF /* POSIX */ +#elif HAVE_SETBUF /* POSIX */ (void) setbuffer(TraceFP, (char *) 0); #endif _tracef("TRACING NCURSES version %s.%d (tracelevel=%#x)", @@ -184,7 +184,11 @@ _nc_va_tracef(const char *fmt, va_list ap) # if USE_WEAK_SYMBOLS if ((pthread_self)) # endif +#ifdef __MINGW32__ + fprintf(TraceFP, "%#lx:", (long) (void *) pthread_self().p); +#else fprintf(TraceFP, "%#lx:", (long) (void *) pthread_self()); +#endif #endif if (before || after) { int n;