From 434d47d2b77b5d5e7a8d0ecc8bfa435579c9a008 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Wed, 11 Mar 2026 14:54:53 +0100 Subject: 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 --- include/sys/select.h | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'include') 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__ extern "C" { #endif -#ifdef __clang__ -#define _FORTIFY_FD_POS0 const __attribute__((__pass_object_size__(0))) -#else -#define _FORTIFY_FD_POS0 -#endif - -static __inline__ __attribute__((__always_inline__,__gnu_inline__,__artificial__)) -void __fortify_FD_CLR(int __f, fd_set * _FORTIFY_FD_POS0 __s) +_FORTIFY_INLINE +void __fortify_FD_CLR(int __f, fd_set * _FORTIFY_POS0 __s) { size_t __b = __bos(__s, 0); @@ -45,8 +39,8 @@ void __fortify_FD_CLR(int __f, fd_set * _FORTIFY_FD_POS0 __s) FD_CLR(__f, __s); } -static __inline__ __attribute__((__always_inline__,__gnu_inline__,__artificial__)) -void __fortify_FD_SET(int __f, fd_set * _FORTIFY_FD_POS0 __s) +_FORTIFY_INLINE +void __fortify_FD_SET(int __f, fd_set * _FORTIFY_POS0 __s) { size_t __b = __bos(__s, 0); @@ -55,8 +49,6 @@ void __fortify_FD_SET(int __f, fd_set * _FORTIFY_FD_POS0 __s) FD_SET(__f, __s); } -#undef _FORTIFY_FD_POS0 - #undef FD_CLR #define FD_CLR(fd, set) __fortify_FD_CLR(fd, set) #undef FD_SET -- cgit v1.3