Skip to content

Commit

Permalink
fixup! feat(util): convert between mixxx::Duration and std::chrono::d…
Browse files Browse the repository at this point in the history
…uration
  • Loading branch information
Swiftb0y committed Aug 24, 2023
1 parent d7efeb8 commit 17626eb
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/util/highresolution_monotonic_clock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,21 @@ auto HighResolutionMonotonicClockFallback::now() noexcept -> time_point {
return time_point(std::chrono::nanoseconds(sec * Q_UINT64_C(1'000'000'000) + frac));
}

#elif defined(Q_OS_WIN)

static qint64 getTimeFromTick(qint64 elapsed) {
static LARGE_INTEGER freq = {{0, 0}};

Check failure on line 121 in src/util/highresolution_monotonic_clock.cpp

View workflow job for this annotation

GitHub Actions / Windows 2019 (MSVC)

missing type specifier - int assumed. Note: C++ does not support default-int

Check failure on line 121 in src/util/highresolution_monotonic_clock.cpp

View workflow job for this annotation

GitHub Actions / Windows 2019 (MSVC)

syntax error: missing ';' before identifier 'freq'

Check failure on line 121 in src/util/highresolution_monotonic_clock.cpp

View workflow job for this annotation

GitHub Actions / Windows 2019 (MSVC)

'freq': undeclared identifier

Check failure on line 121 in src/util/highresolution_monotonic_clock.cpp

View workflow job for this annotation

GitHub Actions / Windows 2019 (MSVC)

an initializer list cannot be used as the right operand of this assignment operator
if (!freq.QuadPart)

Check failure on line 122 in src/util/highresolution_monotonic_clock.cpp

View workflow job for this annotation

GitHub Actions / Windows 2019 (MSVC)

'freq': undeclared identifier
QueryPerformanceFrequency(&freq);

Check failure on line 123 in src/util/highresolution_monotonic_clock.cpp

View workflow job for this annotation

GitHub Actions / Windows 2019 (MSVC)

'freq': undeclared identifier

Check failure on line 123 in src/util/highresolution_monotonic_clock.cpp

View workflow job for this annotation

GitHub Actions / Windows 2019 (MSVC)

'QueryPerformanceFrequency': identifier not found
return 1000000000 * elapsed / freq.QuadPart;

Check failure on line 124 in src/util/highresolution_monotonic_clock.cpp

View workflow job for this annotation

GitHub Actions / Windows 2019 (MSVC)

'freq': undeclared identifier
}

auto HighResolutionMonotonicClockFallback::now() noexcept -> time_point {
LARGE_INTEGER li;

Check failure on line 128 in src/util/highresolution_monotonic_clock.cpp

View workflow job for this annotation

GitHub Actions / Windows 2019 (MSVC)

'LARGE_INTEGER': undeclared identifier

Check failure on line 128 in src/util/highresolution_monotonic_clock.cpp

View workflow job for this annotation

GitHub Actions / Windows 2019 (MSVC)

syntax error: missing ';' before identifier 'li'
QueryPerformanceCounter(&li);
return time_point(std::chrono::nanoseconds(getTimeFromTick(li.QuadPart)));
}

#else

#error Your Platform does not have a high resolution monotonic clock implementation out-of-the-box. Please implement HighResolutionMonotonicClockFallback::now() for your platform.
Expand Down

0 comments on commit 17626eb

Please sign in to comment.