From 3cee2f195039420180ec0d5fafd560385802052c Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Tue, 16 May 2023 09:03:15 +0200 Subject: q20chrono: Fix feature test macro check While the comment behind the else already had the correct value, the actual check and the comment behind the endif had the wrong one. This would cause build /headers clean check failures when using older compilers in C++20/2a mode. Also, remove the check for __cplusplus: A sufficiently high enough value of __cpp_lib_chrono already implies __cplusplus > 201703L; the only thing the check did was to hide the issue on more modern compilers. Fixes compilation with e.g. gcc 9.3. Amends bde5eeecaf35f7b7a94b7878289a8e7fcd057afa Change-Id: I74e761d9dc4048e9abf9cea9ea7e63260ea1111e Reviewed-by: Marc Mutz Reviewed-by: Ahmad Samir --- src/corelib/global/q20chrono.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/global/q20chrono.h b/src/corelib/global/q20chrono.h index 177d307e21..b296b4e966 100644 --- a/src/corelib/global/q20chrono.h +++ b/src/corelib/global/q20chrono.h @@ -38,7 +38,7 @@ using IntRep = int64_t; using IntRep = int; #endif -#if __cpp_lib_chrono >= 201611L && __cplusplus > 201703L +#if __cpp_lib_chrono >= 201907L using std::chrono::days; using std::chrono::weeks; using std::chrono::years; @@ -53,7 +53,7 @@ using days = std::chrono::duration>; using weeks = std::chrono::duration, days::period>>; using years = std::chrono::duration, days::period>>; using months = std::chrono::duration>>; -#endif // __cpp_lib_chrono >= 201611L +#endif // __cpp_lib_chrono >= 201907L } // namespace chrono } // namespace q20 -- cgit v1.2.1