1
0
Fork 0
mirror of https://git.tukaani.org/xz.git synced 2024-04-04 12:36:23 +02:00

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.
This commit is contained in:
Lasse Collin 2023-01-26 17:39:46 +02:00
parent f35d98e206
commit af5a4bd5af

View file

@ -75,12 +75,12 @@
// With GCC >= 8.1 with -Wextra and Clang >= 13 with -Wcast-function-type // With GCC >= 8.1 with -Wextra and Clang >= 13 with -Wcast-function-type
// will warn about the Windows-specific code. // will warn about the Windows-specific code.
#if TUKLIB_GNUC_REQ(8,1) #if defined(__has_warning)
# define CAN_DISABLE_WCAST_FUNCTION_TYPE 1
#elif defined(__has_warning)
# if __has_warning("-Wcast-function-type") # if __has_warning("-Wcast-function-type")
# define CAN_DISABLE_WCAST_FUNCTION_TYPE 1 # define CAN_DISABLE_WCAST_FUNCTION_TYPE 1
# endif # endif
#elif TUKLIB_GNUC_REQ(8,1)
# define CAN_DISABLE_WCAST_FUNCTION_TYPE 1
#endif #endif