Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include <chrono> for system_clock #1811

Merged
merged 1 commit into from
Nov 23, 2024

Conversation

StephanTLavavej
Copy link
Member

I've merged microsoft/STL#5105, which revealed a conformance issue in cpprestsdk.

Compiler error with this STL change:

C:\gitP\Microsoft\cpprestsdk\Release\tests\common\UnitTestpp\src\TestRunner.cpp(173,22): error C3083: 'system_clock': the symbol to the left of a '::' must be a type

Affected cpprestsdk code:

std::chrono::system_clock::time_point totalTime =
std::chrono::system_clock::now() + std::chrono::milliseconds(maxTestTimeInMs);
if (testRunnerFuture.wait_until(totalTime) == std::future_status::timeout)

The problem is that cpprestsdk was assuming that including <future> makes chrono::system_clock available, which is not guaranteed by the C++ Standard. This file needs to explicitly include <chrono>.

@StephanTLavavej StephanTLavavej merged commit 0b1ce31 into microsoft:master Nov 23, 2024
1 check passed
@StephanTLavavej StephanTLavavej deleted the include-chrono branch November 23, 2024 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants