curl.h: require gcc 12.1 for the deprecation magic

Reported-by: kchow-FTNT on github
Fixes #10726
Closes #10784
This commit is contained in:
Daniel Stenberg 2023-03-17 14:48:18 +01:00
parent f5e0f52dd3
commit c3f3c2557c
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -34,11 +34,12 @@
#endif
/* Compile-time deprecation macros. */
#if defined(__GNUC__) && (__GNUC__ >= 6) && \
#if defined(__GNUC__) && \
((__GNUC__ > 12) || ((__GNUC__ == 12) && (__GNUC_MINOR__ >= 1 ))) && \
!defined(__INTEL_COMPILER) && \
!defined(CURL_DISABLE_DEPRECATION) && !defined(BUILDING_LIBCURL)
#define CURL_DEPRECATED(version, message) \
__attribute__((deprecated("since " # version ". " message)))
#define CURL_DEPRECATED(version, message) \
__attribute__((deprecated("since " # version ". " message)))
#define CURL_IGNORE_DEPRECATION(statements) \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \