aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-12-01 17:28:19 +0000
committerlloyd <[email protected]>2009-12-01 17:28:19 +0000
commit9559e323cb631af4e154f5fd30ff2927748817ed (patch)
tree6ededb80d496017a58ba4b862e33c554e54c4e57
parent29e9b23500d101f01988a33e8f1a6aaab39d5f7d (diff)
Instead of checking for Windows generically before using QueryPerformanceCounter,
check a feature macro named BOTAN_OS_HAS_QUERY_PERF_COUNTER, and set the same via configure.py for Windows builds.
-rw-r--r--src/build-data/os/windows.txt1
-rw-r--r--src/entropy/hres_timer/hres_timer.cpp5
2 files changed, 3 insertions, 3 deletions
diff --git a/src/build-data/os/windows.txt b/src/build-data/os/windows.txt
index e72931c98..59e3ec072 100644
--- a/src/build-data/os/windows.txt
+++ b/src/build-data/os/windows.txt
@@ -12,6 +12,7 @@ install_cmd_exec "copy"
<target_features>
win32_virtual_lock
+win32_query_perf_counter
</target_features>
<supports_shared>
diff --git a/src/entropy/hres_timer/hres_timer.cpp b/src/entropy/hres_timer/hres_timer.cpp
index 0f75583ef..e6cc102ed 100644
--- a/src/entropy/hres_timer/hres_timer.cpp
+++ b/src/entropy/hres_timer/hres_timer.cpp
@@ -8,7 +8,7 @@
#include <botan/hres_timer.h>
#include <botan/cpuid.h>
-#if defined(BOTAN_TARGET_OS_IS_WINDOWS)
+#if defined(BOTAN_TARGET_OS_HAS_QUERY_PERF_COUNTER)
#include <windows.h>
#endif
@@ -19,8 +19,7 @@ namespace Botan {
*/
void High_Resolution_Timestamp::poll(Entropy_Accumulator& accum)
{
- // If Windows, grab the Performance Counter (usually TSC or PIT)
-#if defined(BOTAN_TARGET_OS_IS_WINDOWS)
+#if defined(BOTAN_TARGET_OS_HAS_QUERY_PERF_COUNTER)
LARGE_INTEGER tv;
::QueryPerformanceCounter(&tv);
accum.add(tv.QuadPart, 0);