]> git.jsancho.org Git - lugaru.git/blobdiff - Source/MacCompatibility.cpp
More work: compiles, missing like 5 symbols.
[lugaru.git] / Source / MacCompatibility.cpp
index 86d8dff2d45922f144f755142a5e29eac6b0d952..fa28ba02799049b18a4465a34f7395f718757f7e 100644 (file)
@@ -1,10 +1,41 @@
+#if !PLATFORM_MACOSX
+
 /**> HEADER FILES <**/
 #include "MacCompatibility.h"
+
+#ifdef WIN32
 #include <windows.h>
+#endif
+
 #include <errno.h>
 #include <time.h>
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if PLATFORM_UNIX
+#include <unistd.h>
+#include <sys/time.h>
+#include <assert.h>
+typedef long long __int64;
+typedef __int64 LARGE_INTEGER;
+static int QueryPerformanceFrequency(LARGE_INTEGER *liptr)
+{
+    assert(sizeof (__int64) == 8);
+    assert(sizeof (LARGE_INTEGER) == 8);
+    *liptr = 1000;
+    return(1);
+}
 
+static int QueryPerformanceCounter(LARGE_INTEGER *liptr)
+{
+    struct timeval tv;
+    gettimeofday(&tv, NULL);
+    *liptr = ( (((LARGE_INTEGER) tv.tv_sec) * 1000) +
+               (((LARGE_INTEGER) tv.tv_usec) / 1000) );
+    return(1);
+}
+#endif
 
 class AppTime
 {
@@ -22,7 +53,6 @@ public:
 static AppTime g_appTime;
 
 
-
 void CopyCStringToPascal( const char* src, unsigned char dst[256])
 {
        int len = strlen( src);
@@ -106,3 +136,7 @@ char* ConvertFileName( const char* orgfilename)
 
        return g_filename;
 }
+
+#endif
+
+