Mercurial > hg > openttd
changeset 6171:c7702350b836 draft
(svn r8933) -Fix [Win64]: rdtsc now uses intrinsic on VC8 (michi_cc)
author | KUDr <KUDr@openttd.org> |
---|---|
date | Tue, 27 Feb 2007 23:12:45 +0000 |
parents | 07dc23059cb4 |
children | b3b8cbc5e854 |
files | src/os_timer.cpp src/win32.cpp src/win64.asm |
diffstat | 3 files changed, 10 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/src/os_timer.cpp +++ b/src/os_timer.cpp @@ -7,8 +7,12 @@ /* rdtsc for MSC_VER, uses simple inline assembly, or _rdtsc * from external win64.asm because VS2005 does not support inline assembly */ #if defined(_MSC_VER) && !defined(RDTSC_AVAILABLE) -# if defined (_M_AMD64) -extern uint64 _rdtsc(void); +# if _MSC_VER >= 1400 +#include <intrin.h> +uint64 _rdtsc(void) +{ + return __rdtsc(); +} # else uint64 _declspec(naked) _rdtsc(void) {
--- a/src/win32.cpp +++ b/src/win32.cpp @@ -606,10 +606,13 @@ return EXCEPTION_EXECUTE_HANDLER; } +#ifdef _M_AMD64 +extern "C" void *_get_save_esp(void); +#endif + static void Win32InitializeExceptions(void) { #ifdef _M_AMD64 - extern void *_get_save_esp(void); _safe_esp = _get_save_esp(); #else _asm {