diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2022-03-19 18:52:21 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2022-03-19 18:52:21 +0000 |
| commit | dcdbb3613ce66483161e032050c3bed55e7d16b1 (patch) | |
| tree | 781bed96de91c8bbeb348883349d799bacf58066 | |
| parent | char32: add missing header to work with musl (diff) | |
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.
| -rw-r--r-- | char32.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -6,8 +6,12 @@ #include <wctype.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 |
