diff options
author | Alexey Edelev <alexey.edelev@qt.io> | 2021-09-16 11:30:49 +0200 |
---|---|---|
committer | Alexey Edelev <alexey.edelev@qt.io> | 2021-10-05 01:54:46 +0200 |
commit | ef623fd16fa8cb58e7a0f8c04af75ee8b3f2752f (patch) | |
tree | 7a6dc05c4f7283e335c192dd975ce056e8a4aea5 /src/corelib/kernel | |
parent | 52377899d5825520eb791d3100aa003c87c3cff5 (diff) |
Fix __cpp_lib_hypot related error when building in macos
If __cpp_lib_hypot is undefined in macos you may observe the error:
error: '__cpp_lib_hypot' is not defined, evaluates to 0 [-Werror,-Wundef]
Adding the explicit check for definition suppresses the warning that
is treated as an error.
Change-Id: Ie4c185fefde2f5bab699d8fc79b6a170e64af393
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r-- | src/corelib/kernel/qmath.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/kernel/qmath.h b/src/corelib/kernel/qmath.h index 18530714e0..5e8d4fc276 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 <typename Tx, typename Ty, typename Tz> auto qHypot(Tx x, Ty y, Tz z) { |