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.
This commit is contained in:
Daniel Eklöf 2022-03-20 10:50:57 +01:00
parent 4daa3d9904
commit 3ff1c95208
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -5,7 +5,12 @@
#include <assert.h>
#include <wchar.h>
#include <stdc-predef.h>
#if defined __has_include
#if __has_include (<stdc-predef.h>)
#include <stdc-predef.h>
#endif
#endif
#define LOG_MODULE "char32"
#define LOG_ENABLE_DBG 0