build: add more supported attributes to the IAR compiler

Closes #13744
This commit is contained in:
Joseph Chen 2024-05-22 15:35:31 +08:00 committed by Daniel Stenberg
parent 0550ec2bd4
commit 767909be08
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 12 additions and 3 deletions

View File

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

View File

@ -32,7 +32,8 @@
extern "C" {
#endif
#if (defined(__GNUC__) || defined(__clang__)) && \
#if (defined(__GNUC__) || defined(__clang__) || \
defined(__IAR_SYSTEMS_ICC__)) && \
defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
!defined(CURL_NO_FMT_CHECKS)
#if defined(__MINGW32__) && !defined(__clang__)