]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/trace/lib_trace.c
ncurses 5.7 - patch 20110101
[ncurses.git] / ncurses / trace / lib_trace.c
index 0dfc5aacac58f5235c06201524c3fae30b134cae..a726901d4a3a746a30ea4d3cb741a02a16c08ce3 100644 (file)
@@ -47,7 +47,7 @@
 
 #include <ctype.h>
 
-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;