This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Fwd: Patch: fix -fno-builtin builds]
- From: Anthony Green <green at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: Mon, 03 Nov 2003 13:38:09 -0800
- Subject: [Fwd: Patch: fix -fno-builtin builds]
- Organization: Red Hat, Inc.
Resent, since it was bounced from gcc-patches the first time.
Ok?
AG
-----Forwarded Message-----
From: Anthony Green <green@redhat.com>
To: libstdc++@gcc.gnu.org
Subject: Patch: fix -fno-builtin builds
Date: Sat, 01 Nov 2003 21:22:17 -0800
libstdc++ currently depends on the builtin definition of sqrtl. If you
configure and build with -fno-builtin, the compiler will complain like
so:
../../../../../src/libstdc++-v3/libmath/stubs.c:240: error: conflicting
types for 'sqrtl'
../../../../../src/libstdc++-v3/libmath/stubs.c:138: error: previous
implicit declaration of 'sqrtl'
This patch simply reorders sqrt* in stubs.c to avoid this problem. Ok?
2003-11-01 Anthony Green <green@redhat.com>
* libmath/stubs.c (sqrtf,sqrtl): Reorder so they appear before
they're used.
Index: libmath/stubs.c
===================================================================
RCS file: /cvs/uberbaum/libstdc++-v3/libmath/stubs.c,v
retrieving revision 1.11
diff -c -u -p -r1.11 stubs.c
--- libmath/stubs.c 21 May 2003 00:51:24 -0000 1.11
+++ libmath/stubs.c 2 Nov 2003 05:12:59 -0000
@@ -102,6 +102,23 @@ expl(long double x)
#endif
+#ifndef HAVE_SQRTF
+float
+sqrtf(float x)
+{
+ return (float) sqrt(x);
+}
+#endif
+
+#ifndef HAVE_SQRTL
+long double
+sqrtl(long double x)
+{
+ return sqrt((double) x);
+}
+#endif
+
+
/* Compute the hypothenuse of a right triangle with side x and y. */
#ifndef HAVE_HYPOTF
float
@@ -222,23 +239,6 @@ long double
sinhl(long double x)
{
return sinh((double) x);
-}
-#endif
-
-
-#ifndef HAVE_SQRTF
-float
-sqrtf(float x)
-{
- return (float) sqrt(x);
-}
-#endif
-
-#ifndef HAVE_SQRTL
-long double
-sqrtl(long double x)
-{
- return sqrt((double) x);
}
#endif
AG
--
Anthony Green <green@redhat.com>
Red Hat, Inc.