diff options
| author | jvoisin | 2026-03-11 14:54:53 +0100 |
|---|---|---|
| committer | jvoisin | 2026-03-13 01:11:32 +0100 |
| commit | 434d47d2b77b5d5e7a8d0ecc8bfa435579c9a008 (patch) | |
| tree | 5ce4a360264ca53276096a5b3c972cff0878425c /include/sys/select.h | |
| parent | c1642e5a43de3affa75d52c3577ee1be4c874a5d (diff) | |
Fix compilation under clang
Makes uses of _FORTIFY_INLINE and _FORTIFY_POS0 in sys/select.h,
as clang complains about __gnu_inline__ in some cases. An issue
which is already fixed with the shared macros.
It was reported it:
- https://gitlab.alpinelinux.org/alpine/aports/-/issues/18015
- https://gitlab.alpinelinux.org/alpine/aports/-/issues/18000
Co-Authored-By: Sertonix
Diffstat (limited to '')
| -rw-r--r-- | include/sys/select.h | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/include/sys/select.h b/include/sys/select.h index f3d2eb8..58d7852 100644 --- a/include/sys/select.h +++ b/include/sys/select.h | |||
| @@ -29,14 +29,8 @@ __extension__ | |||
| 29 | extern "C" { | 29 | extern "C" { |
| 30 | #endif | 30 | #endif |
| 31 | 31 | ||
| 32 | #ifdef __clang__ | 32 | _FORTIFY_INLINE |
| 33 | #define _FORTIFY_FD_POS0 const __attribute__((__pass_object_size__(0))) | 33 | void __fortify_FD_CLR(int __f, fd_set * _FORTIFY_POS0 __s) |
| 34 | #else | ||
| 35 | #define _FORTIFY_FD_POS0 | ||
| 36 | #endif | ||
| 37 | |||
| 38 | static __inline__ __attribute__((__always_inline__,__gnu_inline__,__artificial__)) | ||
| 39 | void __fortify_FD_CLR(int __f, fd_set * _FORTIFY_FD_POS0 __s) | ||
| 40 | { | 34 | { |
| 41 | size_t __b = __bos(__s, 0); | 35 | size_t __b = __bos(__s, 0); |
| 42 | 36 | ||
| @@ -45,8 +39,8 @@ void __fortify_FD_CLR(int __f, fd_set * _FORTIFY_FD_POS0 __s) | |||
| 45 | FD_CLR(__f, __s); | 39 | FD_CLR(__f, __s); |
| 46 | } | 40 | } |
| 47 | 41 | ||
| 48 | static __inline__ __attribute__((__always_inline__,__gnu_inline__,__artificial__)) | 42 | _FORTIFY_INLINE |
| 49 | void __fortify_FD_SET(int __f, fd_set * _FORTIFY_FD_POS0 __s) | 43 | void __fortify_FD_SET(int __f, fd_set * _FORTIFY_POS0 __s) |
| 50 | { | 44 | { |
| 51 | size_t __b = __bos(__s, 0); | 45 | size_t __b = __bos(__s, 0); |
| 52 | 46 | ||
| @@ -55,8 +49,6 @@ void __fortify_FD_SET(int __f, fd_set * _FORTIFY_FD_POS0 __s) | |||
| 55 | FD_SET(__f, __s); | 49 | FD_SET(__f, __s); |
| 56 | } | 50 | } |
| 57 | 51 | ||
| 58 | #undef _FORTIFY_FD_POS0 | ||
| 59 | |||
| 60 | #undef FD_CLR | 52 | #undef FD_CLR |
| 61 | #define FD_CLR(fd, set) __fortify_FD_CLR(fd, set) | 53 | #define FD_CLR(fd, set) __fortify_FD_CLR(fd, set) |
| 62 | #undef FD_SET | 54 | #undef FD_SET |
