diff --git a/test/test.cpp b/test/test.cpp index 67f3574..ac2e958 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -26,6 +26,10 @@ #include "utest.h" #ifdef _MSC_VER +// test will including mess up the compilation +#pragma warning(push, 0) +#include +#pragma warning(pop) // disable 'conditional expression is constant' - our examples below use this! #pragma warning(disable : 4127) #endif diff --git a/test/test.cpp b/test/test.cpp index 67f3574..ac2e958 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -26,6 +26,10 @@ #include "utest.h" #ifdef _MSC_VER +// test will including mess up the compilation +#pragma warning(push, 0) +#include +#pragma warning(pop) // disable 'conditional expression is constant' - our examples below use this! #pragma warning(disable : 4127) #endif diff --git a/utest.h b/utest.h index 6dc4d4c..74d6679 100644 --- a/utest.h +++ b/utest.h @@ -72,6 +72,16 @@ #endif #if defined(_MSC_VER) +// define UTEST_USE_OLD_QPC before #include "utest.h" to use old QueryPerformanceCounter +#ifndef UTEST_USE_OLD_QPC +#pragma warning(push, 0) +#include +#pragma warning(pop) + +typedef LARGE_INTEGER utest_large_integer; +#else +//use old QueryPerformanceCounter definitions (not sure is this needed in some edge cases or not) +//on Win7 with VS2015 these extern declaration cause "second C linkage of overloaded function not allowed" error typedef union { struct { unsigned long LowPart; @@ -88,6 +98,7 @@ utest_large_integer *); UTEST_C_FUNC __declspec(dllimport) int __stdcall QueryPerformanceFrequency( utest_large_integer *); +#endif #elif defined(__linux__) /*