Log profiler: osx/win32 portability fixes.
authorPaolo Molaro <lupus@oddwiz.org>
Tue, 9 Nov 2010 08:50:44 +0000 (09:50 +0100)
committerPaolo Molaro <lupus@oddwiz.org>
Tue, 9 Nov 2010 08:50:44 +0000 (09:50 +0100)
mono/profiler/proflog.c
mono/profiler/utils.c

index d19c31384d463eedc45bb79760f0119f439e62b7..c669c1cd24903342a75ca56b76c12dd666bda1c2 100644 (file)
 #include <mono/metadata/debug-helpers.h>
 #include <stdlib.h>
 #include <string.h>
-#ifdef HOST_WIN32
-#undef HAVE_ZLIB
-#endif
-#if defined (HAVE_ZLIB)
-#include <zlib.h>
-#endif
 #include <assert.h>
 #ifdef HOST_WIN32
 #include <windows.h>
 #include "utils.c"
 #include "proflog.h"
 
+#ifdef HOST_WIN32
+#undef HAVE_ZLIB
+#endif
+#if defined (HAVE_ZLIB)
+#include <zlib.h>
+#endif
+
 #define BUFFER_SIZE (4096 * 16)
 static int nocalls = 0;
 static int notraces = 0;
index eddd2c06be4165be5d1fe2d0a0c8eeabed809833..1aa4756fec5d5f050c28cb43cfe8d02dd0cda8ee 100644 (file)
@@ -40,7 +40,7 @@
 static mach_timebase_info_data_t timebase_info;
 #endif
 
-#ifndef MAP_ANON
+#ifndef MAP_ANONYMOUS
 #define MAP_ANONYMOUS MAP_ANON
 #endif
 
@@ -90,8 +90,8 @@ clock_time (void)
 #if defined(__APPLE__)
        uint64_t time = mach_absolute_time ();
        
-       time *= info.numer;
-       time /= info.denom;
+       time *= timebase_info.numer;
+       time /= timebase_info.denom;
 
        return time;
 #elif defined(HOST_WIN32)