From 3ff1c95208c2a933d193f38cbd75dbc896a6776f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 20 Mar 2022 10:50:57 +0100 Subject: [PATCH] char32: only include stdc-predef.h if it is available Use the (relatively new) macro __has_include() to check if stdc-predef.h exists, and only include it if it does. If stdc-predef.h does not exist, or if the compiler does not implement __has_include(), stdc-predef.h is *not* included. --- char32.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/char32.c b/char32.c index 71d2ae5..0ca029a 100644 --- a/char32.c +++ b/char32.c @@ -5,7 +5,12 @@ #include #include -#include + +#if defined __has_include + #if __has_include () + #include + #endif +#endif #define LOG_MODULE "char32" #define LOG_ENABLE_DBG 0