This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

[PATCH] add fabsf/fabsl to math stubs


If the system libraries only support fabs (but not fabsf and/or fabsl, i.e.
not [fully] supporting C99), the library doesn't build.

Built and tested for i686-novell-netware on i686-pc-linux-gnu.

I'd like to also apply this against the 4.0 branch, as that otherwise isn't
fully usable for the NetWare target.

Jan

libstdc++-v3/
2005-05-20  Jan Beulich  <jbeulich@novell.com>

	* libmath/stubs.c: Also implement fabsf/fabsl if not present in the
	system libraries.

--- /home/jbeulich/src/gcc/mainline/2005-05-18/libstdc++-v3/libmath/stubs.c	2003-11-15 15:26:47.000000000 +0100
+++ 2005-05-18/libstdc++-v3/libmath/stubs.c	2005-05-11 13:54:17.000000000 +0200
@@ -34,6 +34,23 @@
    we use the crude approximation.  We'll do better later.  */
 
 
+#ifndef HAVE_FABSF
+float
+fabsf(float x)
+{
+  return (float) fabs(x);
+}
+#endif
+
+#ifndef HAVE_FABSL
+long double
+fabsl(long double x)
+{
+  return fabs((double) x);
+}
+#endif
+
+
 #ifndef HAVE_ACOSF
 float
 acosf(float x)


Attachment: libstdc++-mainline-fabs.patch
Description: Text document


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