X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FMacCompatibility.cpp;h=fa28ba02799049b18a4465a34f7395f718757f7e;hb=85c66654b25752485c9a4b4c534263df78e0ff78;hp=86d8dff2d45922f144f755142a5e29eac6b0d952;hpb=40a3dd7b76b6b10ae05dbd074f1f80ea7b4aa96d;p=lugaru.git diff --git a/Source/MacCompatibility.cpp b/Source/MacCompatibility.cpp index 86d8dff..fa28ba0 100644 --- a/Source/MacCompatibility.cpp +++ b/Source/MacCompatibility.cpp @@ -1,10 +1,41 @@ +#if !PLATFORM_MACOSX + /**> HEADER FILES <**/ #include "MacCompatibility.h" + +#ifdef WIN32 #include +#endif + #include #include #include +#include +#include + +#if PLATFORM_UNIX +#include +#include +#include +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 + +