aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Chen <joseph@baoruh.com.tw>2024-05-21 15:30:23 +0800
committerDaniel Stenberg <daniel@haxx.se>2024-05-21 15:10:23 +0200
commitc56071f41fe2d986b4b0e1338cb721a2ed00b480 (patch)
treebb6ee5f89b659c70c52ea44107117af086ffa9c6
parent10a523c5e50f39bad29e556ef9dce7fb97a3e572 (diff)
downloadcurl-upstream-master.tar.gz
curl_setup.h: add support for IAR compilerupstream-master
Closes #13728
-rw-r--r--lib/curl_setup.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/curl_setup.h b/lib/curl_setup.h
index 0fcb2bded..6c05b8752 100644
--- a/lib/curl_setup.h
+++ b/lib/curl_setup.h
@@ -291,7 +291,8 @@
/* based on logic in "curl/mprintf.h" */
-#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__)
@@ -706,6 +707,13 @@
((__GNUC__ == 2) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ >= 7)))
# define UNUSED_PARAM __attribute__((__unused__))
# define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
+#elif defined(__IAR_SYSTEMS_ICC__)
+# define UNUSED_PARAM __attribute__((__unused__))
+# if (__VER__ >= 9040001)
+# define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
+# else
+# define WARN_UNUSED_RESULT
+# endif
#else
# define UNUSED_PARAM /* NOTHING */
# define WARN_UNUSED_RESULT
@@ -714,7 +722,8 @@
/* noreturn attribute */
#if !defined(CURL_NORETURN)
-#if (defined(__GNUC__) && (__GNUC__ >= 3)) || defined(__clang__)
+#if (defined(__GNUC__) && (__GNUC__ >= 3)) || defined(__clang__) || \
+ defined(__IAR_SYSTEMS_ICC__)
# define CURL_NORETURN __attribute__((__noreturn__))
#elif defined(_MSC_VER) && (_MSC_VER >= 1200)
# define CURL_NORETURN __declspec(noreturn)