mirror of
https://github.com/google/benchmark.git
synced 2025-03-31 22:50:14 +08:00
Use Win32 API only for Win32 apps (#1333)
This commit is contained in:
parent
14eee07f4a
commit
1ee7bee6c5
@ -44,6 +44,11 @@
|
|||||||
#define BENCHMARK_OS_CYGWIN 1
|
#define BENCHMARK_OS_CYGWIN 1
|
||||||
#elif defined(_WIN32)
|
#elif defined(_WIN32)
|
||||||
#define BENCHMARK_OS_WINDOWS 1
|
#define BENCHMARK_OS_WINDOWS 1
|
||||||
|
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
|
||||||
|
#define BENCHMARK_OS_WINDOWS_WIN32 1
|
||||||
|
#elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
|
||||||
|
#define BENCHMARK_OS_WINDOWS_RT 1
|
||||||
|
#endif
|
||||||
#if defined(__MINGW32__)
|
#if defined(__MINGW32__)
|
||||||
#define BENCHMARK_OS_MINGW 1
|
#define BENCHMARK_OS_MINGW 1
|
||||||
#endif
|
#endif
|
||||||
|
@ -632,7 +632,7 @@ double GetCPUCyclesPerSecond(CPUInfo::Scaling scaling) {
|
|||||||
fprintf(stderr, "Unable to determine clock rate from sysctl: %s: %s\n",
|
fprintf(stderr, "Unable to determine clock rate from sysctl: %s: %s\n",
|
||||||
FreqStr, strerror(errno));
|
FreqStr, strerror(errno));
|
||||||
|
|
||||||
#elif defined BENCHMARK_OS_WINDOWS
|
#elif defined BENCHMARK_OS_WINDOWS_WIN32
|
||||||
// In NT, read MHz from the registry. If we fail to do so or we're in win9x
|
// In NT, read MHz from the registry. If we fail to do so or we're in win9x
|
||||||
// then make a crude estimate.
|
// then make a crude estimate.
|
||||||
DWORD data, data_size = sizeof(data);
|
DWORD data, data_size = sizeof(data);
|
||||||
|
Loading…
Reference in New Issue
Block a user