diff options
Diffstat (limited to 'compat')
-rw-r--r-- | compat/CMakeLists.txt | 4 | ||||
-rw-r--r-- | compat/timer.cpp | 10 |
2 files changed, 3 insertions, 11 deletions
diff --git a/compat/CMakeLists.txt b/compat/CMakeLists.txt index b58b54e9..3fddefb4 100644 --- a/compat/CMakeLists.txt +++ b/compat/CMakeLists.txt @@ -4,10 +4,6 @@ if(NOT WIN32 AND NOT APPLE) target_link_libraries(opentrack-compat rt) endif() -if(WIN32) - target_link_libraries(opentrack-compat winmm strmiids) -endif() - if(CMAKE_COMPILER_IS_GNUCXX) set_property(SOURCE nan.cpp APPEND_STRING PROPERTY COMPILE_FLAGS "-fno-lto -fno-fast-math -fno-finite-math-only -O0 ") diff --git a/compat/timer.cpp b/compat/timer.cpp index a555018c..55eb200d 100644 --- a/compat/timer.cpp +++ b/compat/timer.cpp @@ -80,13 +80,9 @@ void Timer::gettime(timespec* ts) BOOL ret = QueryPerformanceCounter(&d); assert(ret && "QueryPerformanceCounter failed"); - using ll = long long; - auto part = ll(std::roundl((d.QuadPart * 1000000000.L) / freq)); - using t_s = decltype(ts->tv_sec); - using t_ns = decltype(ts->tv_nsec); - - ts->tv_sec = t_s((long double)d.QuadPart/freq); - ts->tv_nsec = t_ns(part % 1000000000LL); + auto part = (long long)std::roundl((d.QuadPart * 1000000000.L) / freq); + ts->tv_sec = d.QuadPart/freq; + ts->tv_nsec = part % 1000000000; } #elif defined __MACH__ |