Detour/Recast/Demo: Removed GCC reorder warnings (enabled -Wreorder under xcode).

Recast: RecastTimer should compile with null implementation under Linux now.
This commit is contained in:
Mikko Mononen
2009-07-15 12:51:05 +00:00
parent cc1126daaa
commit 6fc3d5c58e
15 changed files with 1039 additions and 4131 deletions
+24 -9
View File
@@ -1,30 +1,31 @@
#include "RecastTimer.h"
#ifdef WIN32
#if defined(WIN32)
// Win32
#include <windows.h>
rcTimeVal rcGetPerformanceTimer()
{
__int64 count;
QueryPerformanceCounter((LARGE_INTEGER*)&count);
return count;
__int64 count;
QueryPerformanceCounter((LARGE_INTEGER*)&count);
return count;
}
int rcGetDeltaTimeUsec(rcTimeVal start, rcTimeVal end)
{
static __int64 freq = 0;
if (freq == 0)
QueryPerformanceFrequency((LARGE_INTEGER*)&freq);
static __int64 freq = 0;
if (freq == 0)
QueryPerformanceFrequency((LARGE_INTEGER*)&freq);
__int64 elapsed = end - start;
return (int)(elapsed*1000000 / freq);
}
#else
#elif defined(__MACH__)
// OSX
#include <mach/mach_time.h>
rcTimeVal rcGetPerformanceTimer()
{
return mach_absolute_time();
@@ -40,4 +41,18 @@ int rcGetDeltaTimeUsec(rcTimeVal start, rcTimeVal end)
return (int)(nanosec / 1000);
}
#else
// TODO: Linux, etc
rcTimeVal rcGetPerformanceTimer()
{
return 0;
}
int rcGetDeltaTimeUsec(rcTimeVal start, rcTimeVal end)
{
return 0;
}
#endif