OSDN Git Service

*: document __USE_EXTERN_INLINES better;
authorDenis Vlasenko <vda.linux@googlemail.com>
Sat, 13 Dec 2008 01:53:28 +0000 (01:53 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Sat, 13 Dec 2008 01:53:28 +0000 (01:53 -0000)
 fix uclibc build if it is forcibly enabled

12 files changed:
include/features.h
libc/sysdeps/linux/common/cmsg_nxthdr.c
libm/float_wrappers.c
libm/ldouble_wrappers.c
libm/s_ceil.c
libm/s_fabs.c
libm/s_finite.c
libm/s_floor.c
libm/s_llrint.c
libm/s_lrint.c
libm/s_signbit.c
libm/s_signbitf.c

index defdd04..1d92a82 100644 (file)
 
 #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
index 7dbf7be..5230fc6 100644 (file)
@@ -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) */
index 58d3926..26041d0 100644 (file)
@@ -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>
 
index d82436d..62732ba 100644 (file)
@@ -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 */
index 76be3ea..c488510 100644 (file)
@@ -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"
 
index deb9138..942a9b8 100644 (file)
@@ -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"
 
index 758da9a..2235d0a 100644 (file)
@@ -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"
 
index 1eccfcd..c9bc2a0 100644 (file)
@@ -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"
 
index 96e1495..b5f75c2 100644 (file)
    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] =
index a0db12d..3cdc8a2 100644 (file)
    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] =
index c9f6527..ee1b7c6 100644 (file)
    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
index ef83d6b..3a5cf0c 100644 (file)
    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)