diff --git a/src/corelib/global/qfloat16.h b/src/corelib/global/qfloat16.h index c2e5379eb42..59739fdcc12 100644 --- a/src/corelib/global/qfloat16.h +++ b/src/corelib/global/qfloat16.h @@ -333,7 +333,7 @@ template <> inline auto qHypot(qfloat16 x, qfloat16 y) return qfloat16(qHypot(float(x), float(y))); #endif } -#if __cpp_lib_hypot >= 201603L // Expected to be true +#if defined(__cpp_lib_hypot) && __cpp_lib_hypot >= 201603L // Expected to be true // If any are not qfloat16, convert each qfloat16 to float: /* (The following splits the some-but-not-all-qfloat16 cases up, using (X|Y|Z)&~(X&Y&Z) = X ? ~(Y&Z) : Y|Z = X&~(Y&Z) | ~X&Y | ~X&~Y&Z, diff --git a/src/corelib/kernel/qmath.h b/src/corelib/kernel/qmath.h index 18530714e0b..5e8d4fc2767 100644 --- a/src/corelib/kernel/qmath.h +++ b/src/corelib/kernel/qmath.h @@ -192,7 +192,7 @@ auto qHypot(Tx x, Ty y) return hypot(x, y); } -#if __cpp_lib_hypot >= 201603L // Expected to be true +#if defined(__cpp_lib_hypot) && __cpp_lib_hypot >= 201603L // Expected to be true template auto qHypot(Tx x, Ty y, Tz z) {