aboutsummaryrefslogtreecommitdiff
path: root/src/common/tuklib_physmem.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2023-01-26 17:39:46 +0200
committerLasse Collin <lasse.collin@tukaani.org>2023-01-26 17:39:46 +0200
commitaf5a4bd5afc089d9697756dded38feafaa987ae4 (patch)
tree9e8ac172c6334cc3636ae709f6c7ff21383a39f1 /src/common/tuklib_physmem.c
parentliblzma: Fix documentation in filter.h for lzma_str_to_filters() (diff)
downloadxz-af5a4bd5afc089d9697756dded38feafaa987ae4.tar.xz
tuklib_physmem: Check for __has_warning before GCC version.
Clang can be configured to fake a too high GCC version so this way it's more robust.
Diffstat (limited to '')
-rw-r--r--src/common/tuklib_physmem.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/tuklib_physmem.c b/src/common/tuklib_physmem.c
index 14a66c03..69f6fd4c 100644
--- a/src/common/tuklib_physmem.c
+++ b/src/common/tuklib_physmem.c
@@ -75,12 +75,12 @@
// With GCC >= 8.1 with -Wextra and Clang >= 13 with -Wcast-function-type
// will warn about the Windows-specific code.
-#if TUKLIB_GNUC_REQ(8,1)
-# define CAN_DISABLE_WCAST_FUNCTION_TYPE 1
-#elif defined(__has_warning)
+#if defined(__has_warning)
# if __has_warning("-Wcast-function-type")
# define CAN_DISABLE_WCAST_FUNCTION_TYPE 1
# endif
+#elif TUKLIB_GNUC_REQ(8,1)
+# define CAN_DISABLE_WCAST_FUNCTION_TYPE 1
#endif