summaryrefslogtreecommitdiff
path: root/win32.c
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2006-03-26 21:15:09 +0000
committerDarkvater <Darkvater@openttd.org>2006-03-26 21:15:09 +0000
commitc9bf9b7553ff4057b08ccb4a274f701114615ec3 (patch)
tree07ce18ba583aad9caf062c352c2632ba1ea394c6 /win32.c
parentf829fa2a73ef16db149c26bb4984afcb8e66cea9 (diff)
downloadopenttd-c9bf9b7553ff4057b08ccb4a274f701114615ec3.tar.xz
(svn r4125) - Feature: Add a general TIC() TOC() mechanism using rdtsc or something similar on non-i386 architectures to performance-tune (critical) code. Some systems are probably missing, but those can be added later.
Diffstat (limited to 'win32.c')
-rw-r--r--win32.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/win32.c b/win32.c
index b95650cca..6987ffcf2 100644
--- a/win32.c
+++ b/win32.c
@@ -62,11 +62,6 @@ bool LoadLibraryList(Function proc[], const char* dll)
}
#ifdef _MSC_VER
-# ifdef _M_AMD64
-void* _get_save_esp(void);
-uint64 _rdtsc(void);
-# endif
-
static const char *_exception_string;
#endif
@@ -594,6 +589,7 @@ static LONG WINAPI ExceptionHandler(EXCEPTION_POINTERS *ep)
static void Win32InitializeExceptions(void)
{
#ifdef _M_AMD64
+ extern void *_get_save_esp(void);
_safe_esp = _get_save_esp();
#else
_asm {
@@ -603,7 +599,7 @@ static void Win32InitializeExceptions(void)
SetUnhandledExceptionFilter(ExceptionHandler);
}
-#endif
+#endif /* _MSC_VER */
static char *_fios_path;
static char *_fios_save_path;
@@ -1057,17 +1053,6 @@ static int ParseCommandLine(char *line, char **argv, int max_argc)
return n;
}
-
-#if defined(_MSC_VER) && !defined(_M_AMD64)
-uint64 _declspec(naked) _rdtsc(void)
-{
- _asm {
- rdtsc
- ret
- }
-}
-#endif
-
void CreateConsole(void)
{
HANDLE hand;