This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Don't check __GNUC__ together with __USE_EXTERN_INLINES


Two places in glibc's installed headers use a condition defined
__GNUC__ && __GNUC__ >= 2 && defined __USE_EXTERN_INLINES.  This is
redundant, since __USE_EXTERN_INLINES is only defined if __GNUC_PREREQ
(2, 7).  (Logically such a combination could make sense of a sort *if*
the inline functions used some other extension, beyond
__extern_inline, but they don't, other than through macros that
sys/cdefs.h defines to empty for compilers not supporting them.)

This patch accordingly changes those conditionals to test just the
logical feature macro __USE_EXTERN_INLINES, and not the GCC version.
Tested x86_64.

2013-01-08  Joseph Myers  <joseph@codesourcery.com>

	* io/sys/stat.h [__GNUC__ && __GNUC__ >= 2 &&
	__USE_EXTERN_INLINES]: Change condition to [__USE_EXTERN_INLINES].
	* sysdeps/unix/sysv/linux/sys/sysmacros.h [__GNUC__ && __GNUC__ >=
	2 && __USE_EXTERN_INLINES]: Likewise.

diff --git a/io/sys/stat.h b/io/sys/stat.h
index 8f7181a..f8263d6 100644
--- a/io/sys/stat.h
+++ b/io/sys/stat.h
@@ -446,7 +446,7 @@ extern int __xmknodat (int __ver, int __fd, const char *__path,
 		       __mode_t __mode, __dev_t *__dev)
      __THROW __nonnull ((3, 5));
 
-#if defined __GNUC__ && __GNUC__ >= 2 && defined __USE_EXTERN_INLINES
+#ifdef __USE_EXTERN_INLINES
 /* Inlined versions of the real stat and mknod functions.  */
 
 __extern_inline int
diff --git a/sysdeps/unix/sysv/linux/sys/sysmacros.h b/sysdeps/unix/sysv/linux/sys/sysmacros.h
index 894a631..76eaf9f 100644
--- a/sysdeps/unix/sysv/linux/sys/sysmacros.h
+++ b/sysdeps/unix/sysv/linux/sys/sysmacros.h
@@ -38,7 +38,7 @@ extern unsigned long long int gnu_dev_makedev (unsigned int __major,
 					       unsigned int __minor)
      __THROW __attribute_const__;
 
-# if defined __GNUC__ && __GNUC__ >= 2 && defined __USE_EXTERN_INLINES
+# ifdef __USE_EXTERN_INLINES
 __extension__ __extern_inline __attribute_const__ unsigned int
 __NTH (gnu_dev_major (unsigned long long int __dev))
 {

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]