fix build errors from rdtsc (fixes #663)
This commit is contained in:
parent
d86c81e26e
commit
396096223e
|
@ -14,6 +14,7 @@
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
//---- Time Stamp Record
|
//---- Time Stamp Record
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
#ifdef __QT_DRIVER__
|
||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
#include <intrin.h>
|
#include <intrin.h>
|
||||||
#pragma intrinsic(__rdtsc)
|
#pragma intrinsic(__rdtsc)
|
||||||
|
@ -25,6 +26,7 @@ static uint64_t rdtsc()
|
||||||
{
|
{
|
||||||
return __rdtsc();
|
return __rdtsc();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace FCEU
|
namespace FCEU
|
||||||
{
|
{
|
||||||
|
@ -36,12 +38,15 @@ uint64_t timeStampRecord::qpcFreq = 0;
|
||||||
|
|
||||||
void timeStampRecord::readNew(void)
|
void timeStampRecord::readNew(void)
|
||||||
{
|
{
|
||||||
#if defined(__linux__) || defined(__APPLE__) || defined(__unix__)
|
#ifdef __QT_DRIVER__
|
||||||
clock_gettime( CLOCK_REALTIME, &ts );
|
tsc = rdtsc();
|
||||||
#else
|
#else
|
||||||
QueryPerformanceCounter((LARGE_INTEGER*)&ts);
|
#if defined(__linux__) || defined(__APPLE__) || defined(__unix__)
|
||||||
#endif
|
clock_gettime( CLOCK_REALTIME, &ts );
|
||||||
tsc = rdtsc();
|
#else
|
||||||
|
QueryPerformanceCounter((LARGE_INTEGER*)&ts);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
void timeStampRecord::qpcCalibrate(void)
|
void timeStampRecord::qpcCalibrate(void)
|
||||||
|
|
Loading…
Reference in New Issue