[PATCH v1 31/35] Don't use plain inline/__inline for meaning GNU inline
Alejandro Colomar
alx@kernel.org
Sun Nov 9 21:54:06 GMT 2025
Use the GCC '__gnu_inline__' attribute explicitly.
It makes the code more readable.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
---
misc/sys/cdefs.h | 5 -----
sysdeps/htl/pthread.h | 5 -----
2 files changed, 10 deletions(-)
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
index 8f565acda1..2320f7293a 100644
--- a/misc/sys/cdefs.h
+++ b/misc/sys/cdefs.h
@@ -491,14 +491,9 @@
#if (!defined __cplusplus || __GNUC_PREREQ (4,3) \
|| (defined __clang__ && (defined __GNUC_STDC_INLINE__ \
|| defined __GNUC_GNU_INLINE__)))
-# if defined __GNUC_STDC_INLINE__ || defined __cplusplus
# define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
# define __extern_always_inline \
extern __always_inline __attribute__ ((__gnu_inline__))
-# else
-# define __extern_inline extern __inline
-# define __extern_always_inline extern __always_inline
-# endif
#endif
#ifdef __extern_always_inline
diff --git a/sysdeps/htl/pthread.h b/sysdeps/htl/pthread.h
index a299fec278..dcb78a2701 100644
--- a/sysdeps/htl/pthread.h
+++ b/sysdeps/htl/pthread.h
@@ -30,7 +30,6 @@
/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
inline semantics, unless -fgnu89-inline is used. */
# if !defined __cplusplus || __GNUC_PREREQ (4,3)
-# if defined __GNUC_STDC_INLINE__ || defined __cplusplus
# define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
# if __GNUC_PREREQ (4,3)
# define __extern_always_inline \
@@ -39,10 +38,6 @@
# define __extern_always_inline \
extern __always_inline __attribute__ ((__gnu_inline__))
# endif
-# else
-# define __extern_inline extern __inline
-# define __extern_always_inline extern __always_inline
-# endif
# endif
#endif
--
2.51.0
More information about the Libc-alpha
mailing list