diff options
Diffstat (limited to 'train_cmd.c')
-rw-r--r-- | train_cmd.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/train_cmd.c b/train_cmd.c index 606dde670..d418469a6 100644 --- a/train_cmd.c +++ b/train_cmd.c @@ -1943,7 +1943,7 @@ static const byte _search_directions[6][4] = { static const byte _pick_track_table[6] = {1, 3, 2, 2, 0, 0}; #if PF_BENCHMARK #if !defined(_MSC_VER) -unsigned int rdtsc() +unsigned int _rdtsc() { unsigned int high, low; @@ -1951,7 +1951,8 @@ unsigned int rdtsc() return low; } #else -static unsigned int _declspec(naked) rdtsc(void) +#ifndef _M_AMD64 +static unsigned int _declspec(naked) _rdtsc(void) { _asm { rdtsc @@ -1960,6 +1961,7 @@ static unsigned int _declspec(naked) rdtsc(void) } #endif #endif +#endif @@ -1969,7 +1971,7 @@ static byte ChooseTrainTrack(Vehicle *v, TileIndex tile, int enterdir, TrackdirB TrainTrackFollowerData fd; uint best_track; #if PF_BENCHMARK - int time = rdtsc(); + int time = _rdtsc(); static float f; #endif @@ -2040,7 +2042,7 @@ static byte ChooseTrainTrack(Vehicle *v, TileIndex tile, int enterdir, TrackdirB } #if PF_BENCHMARK - time = rdtsc() - time; + time = _rdtsc() - time; f = f * 0.99 + 0.01 * time; printf("PF time = %d %f\n", time, f); #endif |