From 66b18f2dbda07555b76096ffa71e30fd480df24e Mon Sep 17 00:00:00 2001 From: castano Date: Wed, 22 Oct 2008 03:48:06 +0000 Subject: [PATCH] Fix build under VC7 --- src/nvcore/CpuInfo.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/nvcore/CpuInfo.h b/src/nvcore/CpuInfo.h index 08a77ab..099cf61 100644 --- a/src/nvcore/CpuInfo.h +++ b/src/nvcore/CpuInfo.h @@ -6,8 +6,10 @@ #include #if NV_CC_MSVC +#if _MSC_VER >= 1400 # include // __rdtsc #endif +#endif namespace nv @@ -27,6 +29,16 @@ namespace nv }; #if NV_CC_MSVC +#if _MSC_VER < 1400 + inline uint64 rdtsc() + { + uint64 t; + __asm rdtsc + __asm mov DWORD PTR [t], eax + __asm mov DWORD PTR [t+4], edx + return t; + } +#else #pragma intrinsic(__rdtsc) inline uint64 rdtsc() @@ -34,6 +46,7 @@ namespace nv return __rdtsc(); } #endif +#endif #if NV_CC_GNUC