From 396096223ec58ff7f437ec0de7275240946531c5 Mon Sep 17 00:00:00 2001 From: zeromus Date: Thu, 7 Sep 2023 18:56:48 -0400 Subject: [PATCH] fix build errors from rdtsc (fixes #663) --- src/utils/timeStamp.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/utils/timeStamp.cpp b/src/utils/timeStamp.cpp index f62d019f..a748fd40 100644 --- a/src/utils/timeStamp.cpp +++ b/src/utils/timeStamp.cpp @@ -14,6 +14,7 @@ //------------------------------------------------------------------------- //---- Time Stamp Record //------------------------------------------------------------------------- +#ifdef __QT_DRIVER__ #if defined(WIN32) #include #pragma intrinsic(__rdtsc) @@ -25,6 +26,7 @@ static uint64_t rdtsc() { return __rdtsc(); } +#endif namespace FCEU { @@ -36,12 +38,15 @@ uint64_t timeStampRecord::qpcFreq = 0; void timeStampRecord::readNew(void) { -#if defined(__linux__) || defined(__APPLE__) || defined(__unix__) - clock_gettime( CLOCK_REALTIME, &ts ); -#else - QueryPerformanceCounter((LARGE_INTEGER*)&ts); -#endif - tsc = rdtsc(); + #ifdef __QT_DRIVER__ + tsc = rdtsc(); + #else + #if defined(__linux__) || defined(__APPLE__) || defined(__unix__) + clock_gettime( CLOCK_REALTIME, &ts ); + #else + QueryPerformanceCounter((LARGE_INTEGER*)&ts); + #endif + #endif } #if defined(WIN32) void timeStampRecord::qpcCalibrate(void)