about summary refs log tree commit diff
path: root/math
diff options
context:
space:
mode:
Diffstat (limited to 'math')
-rw-r--r--math/bits/mathcalls.h4
-rw-r--r--math/complex.h11
-rw-r--r--math/math.h28
-rw-r--r--math/w_j0l.c11
-rw-r--r--math/w_j1l.c10
-rw-r--r--math/w_jnl.c10
6 files changed, 56 insertions, 18 deletions
diff --git a/math/bits/mathcalls.h b/math/bits/mathcalls.h
index 75b2f74556..174fe34589 100644
--- a/math/bits/mathcalls.h
+++ b/math/bits/mathcalls.h
@@ -1,5 +1,5 @@
 /* Prototype declarations for math functions; helper file for <math.h>.
-   Copyright (C) 1996-2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1996-2002, 2003, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -281,7 +281,7 @@ __MATHCALL (rint,, (_Mdouble_ __x));
 
 /* Return X + epsilon if X < Y, X - epsilon if X > Y.  */
 __MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
-# ifdef __USE_ISOC99
+# if defined __USE_ISOC99 && !defined __LDBL_COMPAT
 __MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__));
 # endif
 
diff --git a/math/complex.h b/math/complex.h
index f005a93912..229bb7dca6 100644
--- a/math/complex.h
+++ b/math/complex.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999, 2000, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -84,7 +84,14 @@ __BEGIN_DECLS
 
 /* And the long double versions.  It is non-critical to define them
    here unconditionally since `long double' is required in ISO C99.  */
-#if __STDC__ - 0 || __GNUC__ - 0 && !defined __NO_LONG_DOUBLE_MATH
+#if (__STDC__ - 0 || __GNUC__ - 0) \
+    && (!defined __NO_LONG_DOUBLE_MATH || defined __LDBL_COMPAT)
+# ifdef __LDBL_COMPAT
+#  undef __MATHDECL_1
+#  define __MATHDECL_1(type, function, args) \
+  extern type __REDIRECT(__MATH_PRECNAME(function), args, function) __THROW
+# endif
+
 # ifndef _Mlong_double_
 #  define _Mlong_double_	long double
 # endif
diff --git a/math/math.h b/math/math.h
index 7f8a4815f4..050b89ca85 100644
--- a/math/math.h
+++ b/math/math.h
@@ -1,5 +1,6 @@
 /* Declarations for math functions.
-   Copyright (C) 1991-1993,1995-1999,2001,2002,2004 Free Software Foundation, Inc.
+   Copyright (C) 1991-1993, 1995-1999, 2001, 2002, 2004, 2006
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -96,10 +97,33 @@ __BEGIN_DECLS
 # undef _Mdouble_END_NAMESPACE
 # undef	__MATH_PRECNAME
 
-# if (__STDC__ - 0 || __GNUC__ - 0) && !defined __NO_LONG_DOUBLE_MATH
+# if (__STDC__ - 0 || __GNUC__ - 0) \
+     && (!defined __NO_LONG_DOUBLE_MATH || defined __LDBL_COMPAT)
+#  ifdef __LDBL_COMPAT
+
+#   ifdef __USE_ISOC99 
+extern float __nldbl_nexttowardf (float __x, long double __y)
+				  __attribute__ ((__const__)) __THROW;
+#    ifdef __REDIRECT_NTH
+extern float __REDIRECT_NTH (nexttowardf, (float __x, long double __y),
+			     __nldbl_nexttowardf)
+     __attribute__ ((__const__));
+extern double __REDIRECT_NTH (nexttoward, (double __x, long double __y),
+			      nextafter) __attribute__ ((__const__));
+#    endif
+#   endif
+
 /* Include the file of declarations again, this time using `long double'
    instead of `double' and appending l to each function name.  */
 
+#   undef __MATHDECL_1
+#   define __MATHDECL_2(type, function,suffix, args, alias) \
+  extern type __REDIRECT(__MATH_PRECNAME(function,suffix), \
+			 args, alias) __THROW
+#   define __MATHDECL_1(type, function,suffix, args) \
+  __MATHDECL_2(type, function,suffix, args, __CONCAT(function,suffix))
+#  endif
+
 #  ifndef _Mlong_double_
 #   define _Mlong_double_	long double
 #  endif
diff --git a/math/w_j0l.c b/math/w_j0l.c
index fde0f64f89..1ec6e9e0c2 100644
--- a/math/w_j0l.c
+++ b/math/w_j0l.c
@@ -26,9 +26,9 @@ static char rcsid[] = "$NetBSD: $";
 #include "math_private.h"
 
 #ifdef __STDC__
-	long double j0l(long double x)		/* wrapper j0l */
+	long double __j0l(long double x)		/* wrapper j0l */
 #else
-	long double j0l(x)				/* wrapper j0 */
+	long double __j0l(x)				/* wrapper j0 */
 	long double x;
 #endif
 {
@@ -43,11 +43,12 @@ static char rcsid[] = "$NetBSD: $";
 	    return z;
 #endif
 }
+weak_alias (__j0l, j0l)
 
 #ifdef __STDC__
-	long double y0l(long double x)		/* wrapper y0l */
+	long double __y0l(long double x)		/* wrapper y0l */
 #else
-	long double y0l(x)				/* wrapper y0 */
+	long double __y0l(x)				/* wrapper y0 */
 	long double x;
 #endif
 {
@@ -71,3 +72,5 @@ static char rcsid[] = "$NetBSD: $";
 	    return z;
 #endif
 }
+
+weak_alias (__y0l, y0l)
diff --git a/math/w_j1l.c b/math/w_j1l.c
index 5ecfd1ec6e..7bd31ad995 100644
--- a/math/w_j1l.c
+++ b/math/w_j1l.c
@@ -26,9 +26,9 @@ static char rcsid[] = "$NetBSD: $";
 #include "math_private.h"
 
 #ifdef __STDC__
-	long double j1l(long double x)	/* wrapper j1l */
+	long double __j1l(long double x)	/* wrapper j1l */
 #else
-	long double j1l(x)			/* wrapper j1l */
+	long double __j1l(x)			/* wrapper j1l */
 	long double x;
 #endif
 {
@@ -44,11 +44,12 @@ static char rcsid[] = "$NetBSD: $";
 	    return z;
 #endif
 }
+weak_alias (__j1l, j1l)
 
 #ifdef __STDC__
-	long double y1l(long double x)	/* wrapper y1l */
+	long double __y1l(long double x)	/* wrapper y1l */
 #else
-	long double y1l(x)			/* wrapper y1l */
+	long double __y1l(x)			/* wrapper y1l */
 	long double x;
 #endif
 {
@@ -72,3 +73,4 @@ static char rcsid[] = "$NetBSD: $";
 	    return z;
 #endif
 }
+weak_alias (__y1l, y1l)
diff --git a/math/w_jnl.c b/math/w_jnl.c
index 021c16a104..4bb4d6b620 100644
--- a/math/w_jnl.c
+++ b/math/w_jnl.c
@@ -48,9 +48,9 @@ static char rcsid[] = "$NetBSD: $";
 #include "math_private.h"
 
 #ifdef __STDC__
-	long double jnl(int n, long double x)	/* wrapper jnl */
+	long double __jnl(int n, long double x)	/* wrapper jnl */
 #else
-	long double jnl(n,x)			/* wrapper jnl */
+	long double __jnl(n,x)			/* wrapper jnl */
 	long double x; int n;
 #endif
 {
@@ -66,11 +66,12 @@ static char rcsid[] = "$NetBSD: $";
 	    return z;
 #endif
 }
+weak_alias (__jnl, jnl)
 
 #ifdef __STDC__
-	long double ynl(int n, long double x)	/* wrapper ynl */
+	long double __ynl(int n, long double x)	/* wrapper ynl */
 #else
-	long double ynl(n,x)			/* wrapper ynl */
+	long double __ynl(n,x)			/* wrapper ynl */
 	long double x; int n;
 #endif
 {
@@ -94,3 +95,4 @@ static char rcsid[] = "$NetBSD: $";
 	    return z;
 #endif
 }
+weak_alias (__ynl, ynl)