diff options
| author | jvoisin | 2023-12-07 11:58:47 +0100 |
|---|---|---|
| committer | jvoisin | 2023-12-07 12:07:29 +0100 |
| commit | 9064a508d5f1ed3514d3e5b4734576e80f7048ae (patch) | |
| tree | 488a7315c7362ab1ab1691be54f0b7f6cc9a3c58 /include | |
| parent | 5494a3f9dce8d3cb1a4f4359084a1ef0ee15333e (diff) | |
Add a global test to ensure that all headers are compiling
Diffstat (limited to 'include')
| -rw-r--r-- | include/stdlib.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/include/stdlib.h b/include/stdlib.h index d3cd863..5d89c9c 100644 --- a/include/stdlib.h +++ b/include/stdlib.h | |||
| @@ -23,6 +23,7 @@ __extension__ | |||
| 23 | #include_next <stdlib.h> | 23 | #include_next <stdlib.h> |
| 24 | 24 | ||
| 25 | #if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 | 25 | #if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 |
| 26 | |||
| 26 | #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) | 27 | #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) |
| 27 | #if !defined(__cplusplus) && !defined(__clang__) | 28 | #if !defined(__cplusplus) && !defined(__clang__) |
| 28 | __extension__ | 29 | __extension__ |
| @@ -36,6 +37,9 @@ __extension__ | |||
| 36 | extern "C" { | 37 | extern "C" { |
| 37 | #endif | 38 | #endif |
| 38 | 39 | ||
| 40 | |||
| 41 | /* FIXME clang */ | ||
| 42 | #if !defined(__clang__) | ||
| 39 | #undef malloc | 43 | #undef malloc |
| 40 | #undef realloc | 44 | #undef realloc |
| 41 | #undef calloc | 45 | #undef calloc |
| @@ -84,8 +88,7 @@ _FORTIFY_FN(reallocarray) void* reallocarray(void* __p, size_t __n, size_t __s) | |||
| 84 | } | 88 | } |
| 85 | #endif | 89 | #endif |
| 86 | 90 | ||
| 87 | /* FIXME clang */ | 91 | #if (defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)) |
| 88 | #if (defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)) && !defined(__clang__) | ||
| 89 | #undef realpath | 92 | #undef realpath |
| 90 | __warning_if(__p == NULL, "'realpath' called with path set to `NULL`; did you invert the arguments?") | 93 | __warning_if(__p == NULL, "'realpath' called with path set to `NULL`; did you invert the arguments?") |
| 91 | #if __has_builtin(__builtin_realpath) | 94 | #if __has_builtin(__builtin_realpath) |
| @@ -118,6 +121,8 @@ _FORTIFY_FN(realpath) char *realpath(const char *__p, char *__r) | |||
| 118 | } | 121 | } |
| 119 | #endif | 122 | #endif |
| 120 | 123 | ||
| 121 | #endif | 124 | #endif // clang |
| 125 | |||
| 126 | #endif // _FORTIFY_SOURCE | ||
| 122 | 127 | ||
| 123 | #endif | 128 | #endif |
