diff options
| author | Trutz Behn | 2015-06-04 15:01:37 +0200 |
|---|---|---|
| committer | sin | 2015-06-04 18:52:50 +0100 |
| commit | 4cdac9cbdaa01f884e0e8b3f947b7f0cb1170729 (patch) | |
| tree | 19846913f4987623f2dcdca8b40addd34a109792 /include/sys | |
| parent | 1cd5461a5375207602f2cbdfd9a50a9b751cb7c8 (diff) | |
Use the __inline__ keyword instead of __inline to avoid breakage
Newer compilers default to GNU11, a C11 dialect. Some software however
is unprepared for this or has wrong compatibility checks. What happens
is that some software will for compatibility with C89
#define inline
before inclusion of a standard header, which is undefined behaviour in
C99 and above (C99/C11 7.1.2/4), as inline is a keyword.
If any libc headers that are then included via #include_next provide an
__inline macro definition (current musl does this if C++ or C99 and
above is detected) like the following
#define __inline inline
this results in any __inline token to be preprocessed away.
This breaks use of __builtin_va_arg_pack() in our stdio.h at
compile-time as it can only be used in always inlined functions. The
function attributes __always_inline__ and __gnu_inline__ themselves
require an inline specifier on the function to be applied.
Diffstat (limited to '')
| -rw-r--r-- | include/sys/select.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/sys/select.h b/include/sys/select.h index 4623071..db6135d 100644 --- a/include/sys/select.h +++ b/include/sys/select.h | |||
| @@ -24,7 +24,7 @@ | |||
| 24 | extern "C" { | 24 | extern "C" { |
| 25 | #endif | 25 | #endif |
| 26 | 26 | ||
| 27 | static __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__)) | 27 | static __inline__ __attribute__((__always_inline__,__gnu_inline__,__artificial__)) |
| 28 | void __fortify_FD_CLR(int __f, fd_set *__s) | 28 | void __fortify_FD_CLR(int __f, fd_set *__s) |
| 29 | { | 29 | { |
| 30 | size_t __b = __builtin_object_size(__s, 0); | 30 | size_t __b = __builtin_object_size(__s, 0); |
| @@ -34,7 +34,7 @@ void __fortify_FD_CLR(int __f, fd_set *__s) | |||
| 34 | FD_CLR(__f, __s); | 34 | FD_CLR(__f, __s); |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | static __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__)) | 37 | static __inline__ __attribute__((__always_inline__,__gnu_inline__,__artificial__)) |
| 38 | void __fortify_FD_SET(int __f, fd_set *__s) | 38 | void __fortify_FD_SET(int __f, fd_set *__s) |
| 39 | { | 39 | { |
| 40 | size_t __b = __builtin_object_size(__s, 0); | 40 | size_t __b = __builtin_object_size(__s, 0); |
