From 4401d2119964db189f5393d3f5356af76c697b8b Mon Sep 17 00:00:00 2001 From: Andy Vandijck Date: Mon, 19 Feb 2024 08:52:37 +0100 Subject: [PATCH] Fix for other than i386/x86_64 windows archs Fix for other than i386/x86_64 windows archs. Timestamp update. --- src/utils/timeStamp.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/utils/timeStamp.cpp b/src/utils/timeStamp.cpp index 8fd11e9f..1cd10ba5 100644 --- a/src/utils/timeStamp.cpp +++ b/src/utils/timeStamp.cpp @@ -16,9 +16,13 @@ //------------------------------------------------------------------------- #ifdef __FCEU_X86_TSC_ENABLE #if defined(WIN32) -#include +#if defined(_M_IX86) || defined(_M_AMD64) || defined(__i386__) || defined(__x86_64__) +#include __ #pragma intrinsic(__rdtsc) #else +#include +#endif +#else #if defined(__x86_64_) || defined(__i386__) #include #endif @@ -41,9 +45,17 @@ static uint64_t rdtsc() return val; #else +#if defined(_M_IX86) || defined(_M_AMD64) || defined(__i386__) || defined(__x86_64__) return __rdtsc(); +#else + LARGE_INTEGER val; + + QueryPerformanceCounter(&val); + + return (uint64_t)(val.QuadPart); #endif -} +#endif ++} #endif namespace FCEU