Browse Source

*: document __USE_EXTERN_INLINES better;
fix uclibc build if it is forcibly enabled

Denis Vlasenko 16 years ago
parent
commit
0f55c533b6

+ 11 - 3
include/features.h

@@ -365,9 +365,17 @@
 
 #endif	/* !ASSEMBLER */
 
-/* Decide whether we can define 'extern inline' functions in headers.  */
-#if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \
-    && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__ \
+/* Decide whether we can, and are willing to define extern inline
+ * functions in headers, even if this results in a slightly bigger
+ * code for user programs built against uclibc.
+ * Enabled only in -O2 compiles, not -Os.
+ * uclibc itself is usually built without __USE_EXTERN_INLINES,
+ * remove "&& !defined __OPTIMIZE_SIZE__" part to do otherwise.
+ */
+#if __GNUC_PREREQ (2, 7) \
+    && defined __OPTIMIZE__ \
+    && !defined __OPTIMIZE_SIZE__ \
+    && !defined __NO_INLINE__ \
     && (defined __extern_inline || defined __GNUC_GNU_INLINE__)
 # define __USE_EXTERN_INLINES	1
 #endif

+ 2 - 0
libc/sysdeps/linux/common/cmsg_nxthdr.c

@@ -19,6 +19,8 @@
 
 #define __FORCE_GLIBC
 #include <features.h>
+/* Prevent math.h from defining a colliding inline */
+#undef __USE_EXTERN_INLINES
 #include <sys/socket.h>
 
 /* libc_hidden_proto(__cmsg_nxthdr) */

+ 3 - 0
libm/float_wrappers.c

@@ -10,6 +10,9 @@
  * GNU Lesser General Public License version 2.1 or later.
  */
 
+#include <features.h>
+/* Prevent math.h from defining colliding inlines */
+#undef __USE_EXTERN_INLINES
 #include <math.h>
 #include <complex.h>
 

+ 3 - 0
libm/ldouble_wrappers.c

@@ -10,6 +10,9 @@
  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  */
 
+#include <features.h>
+/* Prevent math.h from defining colliding inlines */
+#undef __USE_EXTERN_INLINES
 #include "math.h"
 
 /* Implement the following, as defined by SuSv3 */

+ 3 - 0
libm/s_ceil.c

@@ -23,6 +23,9 @@ static char rcsid[] = "$NetBSD: s_ceil.c,v 1.8 1995/05/10 20:46:53 jtc Exp $";
  *	Inexact flag raised if x not equal to ceil(x).
  */
 
+#include <features.h>
+/* Prevent math.h from defining a colliding inline */
+#undef __USE_EXTERN_INLINES
 #include "math.h"
 #include "math_private.h"
 

+ 3 - 0
libm/s_fabs.c

@@ -18,6 +18,9 @@ static char rcsid[] = "$NetBSD: s_fabs.c,v 1.7 1995/05/10 20:47:13 jtc Exp $";
  * fabs(x) returns the absolute value of x.
  */
 
+#include <features.h>
+/* Prevent math.h from defining a colliding inline */
+#undef __USE_EXTERN_INLINES
 #include "math.h"
 #include "math_private.h"
 

+ 3 - 0
libm/s_finite.c

@@ -15,6 +15,9 @@
  * no branching!
  */
 
+#include <features.h>
+/* Prevent math.h from defining a colliding inline */
+#undef __USE_EXTERN_INLINES
 #include "math.h"
 #include "math_private.h"
 

+ 3 - 0
libm/s_floor.c

@@ -23,6 +23,9 @@ static char rcsid[] = "$NetBSD: s_floor.c,v 1.8 1995/05/10 20:47:20 jtc Exp $";
  *	Inexact flag raised if x not equal to floor(x).
  */
 
+#include <features.h>
+/* Prevent math.h from defining a colliding inline */
+#undef __USE_EXTERN_INLINES
 #include "math.h"
 #include "math_private.h"
 

+ 3 - 1
libm/s_llrint.c

@@ -19,8 +19,10 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <features.h>
+/* Prevent math.h from defining a colliding inline */
+#undef __USE_EXTERN_INLINES
 #include <math.h>
-
 #include "math_private.h"
 
 static const double two52[2] =

+ 3 - 1
libm/s_lrint.c

@@ -19,8 +19,10 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <features.h>
+/* Prevent math.h from defining a colliding inline */
+#undef __USE_EXTERN_INLINES
 #include <math.h>
-
 #include "math_private.h"
 
 static const double two52[2] =

+ 3 - 1
libm/s_signbit.c

@@ -18,8 +18,10 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <features.h>
+/* Prevent math.h from defining a colliding inline */
+#undef __USE_EXTERN_INLINES
 #include <math.h>
-
 #include "math_private.h"
 
 int

+ 3 - 1
libm/s_signbitf.c

@@ -18,8 +18,10 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <features.h>
+/* Prevent math.h from defining a colliding inline */
+#undef __USE_EXTERN_INLINES
 #include <math.h>
-
 #include "math_private.h"
 
 libm_hidden_proto(__signbitf)