patches/uClibc/0.9.30.1/160-c99-ldbl-math.patch
branchnewlib
changeset 1365 c4d124ed9f8e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/uClibc/0.9.30.1/160-c99-ldbl-math.patch	Sun Apr 19 16:17:11 2009 +0000
     1.3 @@ -0,0 +1,474 @@
     1.4 +Index: uClibc-0.9.30.1/libm/ldouble_wrappers.c
     1.5 +===================================================================
     1.6 +--- uClibc-0.9.30.1/libm/ldouble_wrappers.c	(revision 25552)
     1.7 ++++ uClibc-0.9.30.1/libm/ldouble_wrappers.c	(working copy)
     1.8 +@@ -13,6 +13,16 @@
     1.9 + #include "math.h"
    1.10 + #include <complex.h>
    1.11 + 
    1.12 ++#if defined __NO_LONG_DOUBLE_MATH
    1.13 ++# define int_WRAPPER_C99(func) /* not needed */
    1.14 ++# else
    1.15 ++# define int_WRAPPER_C99(func) \
    1.16 ++int func##l(long double x) \
    1.17 ++{ \
    1.18 ++    return func((double) x); \
    1.19 ++} \
    1.20 ++libm_hidden_def(func##l)
    1.21 ++#endif
    1.22 + 
    1.23 + /* Implement the following, as defined by SuSv3 */
    1.24 + #if 0
    1.25 +@@ -543,46 +553,28 @@ long double truncl (long double x)
    1.26 + #endif
    1.27 + 
    1.28 + 
    1.29 +-#ifdef __DO_C99_MATH__
    1.30 ++#if defined __DO_C99_MATH__
    1.31 + 
    1.32 + #ifdef L_fpclassifyl
    1.33 +-int __fpclassifyl (long double x)
    1.34 +-{
    1.35 +-	return __fpclassify ( (double) x );
    1.36 +-}
    1.37 +-libm_hidden_def(__fpclassifyl)
    1.38 ++int_WRAPPER_C99(__fpclassify)
    1.39 + #endif
    1.40 + 
    1.41 + #ifdef L_finitel
    1.42 +-int __finitel (long double x)
    1.43 +-{
    1.44 +-	return __finite ( (double)x );
    1.45 +-}
    1.46 +-libm_hidden_def(__finitel)
    1.47 ++int_WRAPPER_C99(__finite)
    1.48 + #endif
    1.49 + 
    1.50 + #ifdef L_signbitl
    1.51 +-int __signbitl (long double x)
    1.52 +-{
    1.53 +-	return __signbitl ( (double)x );
    1.54 +-}
    1.55 +-libm_hidden_def(__signbitl)
    1.56 ++int_WRAPPER_C99(__signbit)
    1.57 + #endif
    1.58 + 
    1.59 + #ifdef L_isnanl
    1.60 +-int __isnanl (long double x)
    1.61 +-{
    1.62 +-	return __isnan ( (double)x );
    1.63 +-}
    1.64 +-libm_hidden_def(__isnanl)
    1.65 ++int_WRAPPER_C99(__isnan)
    1.66 + #endif
    1.67 + 
    1.68 + #ifdef L_isinfl
    1.69 +-int __isinfl (long double x)
    1.70 +-{
    1.71 +-	return __isinf ( (double)x );
    1.72 +-}
    1.73 +-libm_hidden_def(__isinfl)
    1.74 ++int_WRAPPER_C99(__isinf)
    1.75 + #endif
    1.76 + 
    1.77 +-#endif
    1.78 ++#endif /* DO_C99_MATH */
    1.79 ++
    1.80 ++#undef int_WRAPPER_C99
    1.81 +Index: uClibc-0.9.30.1/libm/nan.c
    1.82 +===================================================================
    1.83 +--- uClibc-0.9.30.1/libm/nan.c	(revision 25552)
    1.84 ++++ uClibc-0.9.30.1/libm/nan.c	(working copy)
    1.85 +@@ -45,7 +45,7 @@ float nanf (const char *tagp)
    1.86 + }
    1.87 + libm_hidden_def(nanf)
    1.88 + 
    1.89 +-#if defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
    1.90 ++#if defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ && !defined __NO_LONG_DOUBLE_MATH
    1.91 + libm_hidden_proto(nanl)
    1.92 + long double nanl (const char *tagp)
    1.93 + {
    1.94 +Index: uClibc-0.9.30.1/include/math.h
    1.95 +===================================================================
    1.96 +--- uClibc-0.9.30.1/include/math.h	(revision 25552)
    1.97 ++++ uClibc-0.9.30.1/include/math.h	(working copy)
    1.98 +@@ -118,7 +118,7 @@ __BEGIN_DECLS
    1.99 + # undef	__MATH_PRECNAME
   1.100 + 
   1.101 + # if (__STDC__ - 0 || __GNUC__ - 0) \
   1.102 +-     && (defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ || defined __LDBL_COMPAT)
   1.103 ++     && (!defined __NO_LONG_DOUBLE_MATH || defined __LDBL_COMPAT)
   1.104 + #  ifdef __LDBL_COMPAT
   1.105 + 
   1.106 + #   ifdef __USE_ISOC99
   1.107 +@@ -230,7 +230,7 @@ enum
   1.108 +   };
   1.109 + 
   1.110 + /* Return number of classification appropriate for X.  */
   1.111 +-# ifndef __UCLIBC_HAS_LONG_DOUBLE_MATH__
   1.112 ++# ifdef __NO_LONG_DOUBLE_MATH
   1.113 + #  define fpclassify(x) \
   1.114 +      (sizeof (x) == sizeof (float) ? __fpclassifyf (x) : __fpclassify (x))
   1.115 + # else
   1.116 +@@ -242,7 +242,7 @@ enum
   1.117 + # endif
   1.118 + 
   1.119 + /* Return nonzero value if sign of X is negative.  */
   1.120 +-# ifndef __UCLIBC_HAS_LONG_DOUBLE_MATH__
   1.121 ++# ifdef __NO_LONG_DOUBLE_MATH
   1.122 + #  define signbit(x) \
   1.123 +      (sizeof (x) == sizeof (float) ? __signbitf (x) : __signbit (x))
   1.124 + # else
   1.125 +@@ -254,7 +254,7 @@ enum
   1.126 + # endif
   1.127 + 
   1.128 + /* Return nonzero value if X is not +-Inf or NaN.  */
   1.129 +-# ifndef __UCLIBC_HAS_LONG_DOUBLE_MATH__
   1.130 ++# ifdef __NO_LONG_DOUBLE_MATH
   1.131 + #  define isfinite(x) \
   1.132 +      (sizeof (x) == sizeof (float) ? __finitef (x) : __finite (x))
   1.133 + # else
   1.134 +@@ -270,7 +270,7 @@ enum
   1.135 + 
   1.136 + /* Return nonzero value if X is a NaN.  We could use `fpclassify' but
   1.137 +    we already have this functions `__isnan' and it is faster.  */
   1.138 +-# ifndef __UCLIBC_HAS_LONG_DOUBLE_MATH__
   1.139 ++# ifdef __NO_LONG_DOUBLE_MATH
   1.140 + #  define isnan(x) \
   1.141 +      (sizeof (x) == sizeof (float) ? __isnanf (x) : __isnan (x))
   1.142 + # else
   1.143 +@@ -282,7 +282,7 @@ enum
   1.144 + # endif
   1.145 + 
   1.146 + /* Return nonzero value is X is positive or negative infinity.  */
   1.147 +-# ifndef __UCLIBC_HAS_LONG_DOUBLE_MATH__
   1.148 ++# ifdef __NO_LONG_DOUBLE_MATH
   1.149 + #  define isinf(x) \
   1.150 +      (sizeof (x) == sizeof (float) ? __isinff (x) : __isinf (x))
   1.151 + # else
   1.152 +Index: uClibc-0.9.30.1/include/tgmath.h
   1.153 +===================================================================
   1.154 +--- uClibc-0.9.30.1/include/tgmath.h	(revision 25552)
   1.155 ++++ uClibc-0.9.30.1/include/tgmath.h	(working copy)
   1.156 +@@ -36,7 +36,7 @@
   1.157 + 
   1.158 + #if __GNUC_PREREQ(2, 7)
   1.159 + 
   1.160 +-# ifndef __UCLIBC_HAS_LONG_DOUBLE_MATH__
   1.161 ++# ifdef __NO_LONG_DOUBLE_MATH
   1.162 + #  define __tgml(fct) fct
   1.163 + # else
   1.164 + #  define __tgml(fct) fct ## l
   1.165 +Index: uClibc-0.9.30.1/libc/sysdeps/linux/powerpc/bits/wordsize.h
   1.166 +===================================================================
   1.167 +--- uClibc-0.9.30.1/libc/sysdeps/linux/powerpc/bits/wordsize.h	(revision 25552)
   1.168 ++++ uClibc-0.9.30.1/libc/sysdeps/linux/powerpc/bits/wordsize.h	(working copy)
   1.169 +@@ -7,13 +7,13 @@
   1.170 + # define __WORDSIZE	32
   1.171 + #endif
   1.172 + 
   1.173 +-#if defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ && !defined __LONG_DOUBLE_MATH_OPTIONAL
   1.174 ++#if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL
   1.175 + 
   1.176 + /* Signal the glibc ABI didn't used to have a `long double'.
   1.177 +    The changes all the `long double' function variants to be redirects
   1.178 +    to the double functions.  */
   1.179 + # define __LONG_DOUBLE_MATH_OPTIONAL   1
   1.180 + # ifndef __LONG_DOUBLE_128__
   1.181 +-#  undef __UCLIBC_HAS_LONG_DOUBLE_MATH__
   1.182 ++#  define __NO_LONG_DOUBLE_MATH        1
   1.183 + # endif
   1.184 + #endif
   1.185 +Index: uClibc-0.9.30.1/libc/sysdeps/linux/powerpc/bits/mathdef.h
   1.186 +===================================================================
   1.187 +--- uClibc-0.9.30.1/libc/sysdeps/linux/powerpc/bits/mathdef.h	(revision 25552)
   1.188 ++++ uClibc-0.9.30.1/libc/sysdeps/linux/powerpc/bits/mathdef.h	(working copy)
   1.189 +@@ -65,11 +65,13 @@ typedef double double_t;
   1.190 + 
   1.191 + #endif	/* ISO C99 */
   1.192 + 
   1.193 +-#ifdef __UCLIBC_HAS_LONG_DOUBLE_MATH__
   1.194 ++#ifndef __NO_LONG_DOUBLE_MATH
   1.195 + #include <bits/wordsize.h>
   1.196 + /* Signal that we do not really have a `long double'.  The disables the
   1.197 +    declaration of all the `long double' function variants.  */
   1.198 + # if __WORDSIZE == 32
   1.199 +-#  undef __UCLIBC_HAS_LONG_DOUBLE_MATH__
   1.200 ++#  define __NO_LONG_DOUBLE_MATH	1
   1.201 ++# elif !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
   1.202 ++#  define __NO_LONG_DOUBLE_MATH	1
   1.203 + # endif  /* __WORDSIZE == 32 */
   1.204 +-#endif  /* __UCLIBC_HAS_LONG_DOUBLE_MATH__ */
   1.205 ++#endif  /* __NO_LONG_DOUBLE_MATH */
   1.206 +Index: uClibc-0.9.30.1/libc/sysdeps/linux/arm/bits/mathdef.h
   1.207 +===================================================================
   1.208 +--- uClibc-0.9.30.1/libc/sysdeps/linux/arm/bits/mathdef.h	(revision 25552)
   1.209 ++++ uClibc-0.9.30.1/libc/sysdeps/linux/arm/bits/mathdef.h	(working copy)
   1.210 +@@ -34,3 +34,11 @@ typedef double double_t;	/* `double' exp
   1.211 + # define FP_ILOGBNAN	(2147483647)
   1.212 + 
   1.213 + #endif	/* ISO C99 */
   1.214 ++
   1.215 ++#ifndef __NO_LONG_DOUBLE_MATH
   1.216 ++/* Signal that we do not really have a `long double'.  This disables the
   1.217 ++   declaration of all the `long double' function variants.  */
   1.218 ++/* XXX The FPA does support this but the patterns in GCC are currently
   1.219 ++   turned off.  */
   1.220 ++# define __NO_LONG_DOUBLE_MATH	1
   1.221 ++#endif
   1.222 +Index: uClibc-0.9.30.1/libc/sysdeps/linux/m68k/bits/mathdef.h
   1.223 +===================================================================
   1.224 +--- uClibc-0.9.30.1/libc/sysdeps/linux/m68k/bits/mathdef.h	(revision 25552)
   1.225 ++++ uClibc-0.9.30.1/libc/sysdeps/linux/m68k/bits/mathdef.h	(working copy)
   1.226 +@@ -36,3 +36,7 @@ typedef long double double_t;	/* `double
   1.227 + # define FP_ILOGBNAN	(2147483647)
   1.228 + 
   1.229 + #endif	/* ISO C99 */
   1.230 ++
   1.231 ++#if !defined __NO_LONG_DOUBLE_MATH && !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
   1.232 ++# define __NO_LONG_DOUBLE_MATH	1
   1.233 ++#endif
   1.234 +Index: uClibc-0.9.30.1/libc/sysdeps/linux/alpha/bits/wordsize.h
   1.235 +===================================================================
   1.236 +--- uClibc-0.9.30.1/libc/sysdeps/linux/alpha/bits/wordsize.h	(revision 25552)
   1.237 ++++ uClibc-0.9.30.1/libc/sysdeps/linux/alpha/bits/wordsize.h	(working copy)
   1.238 +@@ -18,13 +18,13 @@
   1.239 + 
   1.240 + #define __WORDSIZE	64
   1.241 + 
   1.242 +-#if defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ && !defined __LONG_DOUBLE_MATH_OPTIONAL
   1.243 ++#if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL
   1.244 + 
   1.245 + /* Signal that we didn't used to have a `long double'. The changes all
   1.246 +    the `long double' function variants to be redirects to the double
   1.247 +    functions.  */
   1.248 + # define __LONG_DOUBLE_MATH_OPTIONAL	1
   1.249 + # ifndef __LONG_DOUBLE_128__
   1.250 +-#  undef __UCLIBC_HAS_LONG_DOUBLE_MATH__
   1.251 ++#  define __NO_LONG_DOUBLE_MATH		1
   1.252 + # endif
   1.253 + #endif
   1.254 +Index: uClibc-0.9.30.1/libc/sysdeps/linux/alpha/bits/mathdef.h
   1.255 +===================================================================
   1.256 +--- uClibc-0.9.30.1/libc/sysdeps/linux/alpha/bits/mathdef.h	(revision 25552)
   1.257 ++++ uClibc-0.9.30.1/libc/sysdeps/linux/alpha/bits/mathdef.h	(working copy)
   1.258 +@@ -78,3 +78,7 @@ typedef double double_t;
   1.259 + 
   1.260 + # endif /* GNUC before 3.4 */
   1.261 + #endif /* COMPLEX_H */
   1.262 ++
   1.263 ++#if !defined __NO_LONG_DOUBLE_MATH && !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
   1.264 ++# define __NO_LONG_DOUBLE_MATH	1
   1.265 ++#endif
   1.266 +Index: uClibc-0.9.30.1/libc/sysdeps/linux/common/bits/mathdef.h
   1.267 +===================================================================
   1.268 +--- uClibc-0.9.30.1/libc/sysdeps/linux/common/bits/mathdef.h	(revision 25552)
   1.269 ++++ uClibc-0.9.30.1/libc/sysdeps/linux/common/bits/mathdef.h	(working copy)
   1.270 +@@ -35,3 +35,9 @@ typedef double double_t;	/* `double' exp
   1.271 + # define FP_ILOGBNAN	2147483647
   1.272 + 
   1.273 + #endif	/* ISO C99 */
   1.274 ++
   1.275 ++#ifndef __NO_LONG_DOUBLE_MATH
   1.276 ++/* Signal that we do not really have a `long double'.  The disables the
   1.277 ++   declaration of all the `long double' function variants.  */
   1.278 ++# define __NO_LONG_DOUBLE_MATH	1
   1.279 ++#endif
   1.280 +Index: uClibc-0.9.30.1/libc/sysdeps/linux/i386/bits/mathdef.h
   1.281 +===================================================================
   1.282 +--- uClibc-0.9.30.1/libc/sysdeps/linux/i386/bits/mathdef.h	(revision 25552)
   1.283 ++++ uClibc-0.9.30.1/libc/sysdeps/linux/i386/bits/mathdef.h	(working copy)
   1.284 +@@ -44,3 +44,7 @@ typedef long double double_t;	/* `double
   1.285 + # define FP_ILOGBNAN	(-2147483647 - 1)
   1.286 + 
   1.287 + #endif	/* ISO C99 */
   1.288 ++
   1.289 ++#if !defined __NO_LONG_DOUBLE_MATH && !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
   1.290 ++# define __NO_LONG_DOUBLE_MATH	1
   1.291 ++#endif
   1.292 +Index: uClibc-0.9.30.1/libc/sysdeps/linux/nios2/bits/mathdef.h
   1.293 +===================================================================
   1.294 +--- uClibc-0.9.30.1/libc/sysdeps/linux/nios2/bits/mathdef.h	(revision 25552)
   1.295 ++++ uClibc-0.9.30.1/libc/sysdeps/linux/nios2/bits/mathdef.h	(working copy)
   1.296 +@@ -34,3 +34,11 @@ typedef double double_t;	/* `double' exp
   1.297 + # define FP_ILOGBNAN	(2147483647)
   1.298 + 
   1.299 + #endif	/* ISO C99 */
   1.300 ++
   1.301 ++#ifndef __NO_LONG_DOUBLE_MATH
   1.302 ++/* Signal that we do not really have a `long double'.  This disables the
   1.303 ++   declaration of all the `long double' function variants.  */
   1.304 ++/* XXX The FPA does support this but the patterns in GCC are currently
   1.305 ++   turned off.  */
   1.306 ++# define __NO_LONG_DOUBLE_MATH	1
   1.307 ++#endif
   1.308 +Index: uClibc-0.9.30.1/libc/sysdeps/linux/x86_64/bits/mathdef.h
   1.309 +===================================================================
   1.310 +--- uClibc-0.9.30.1/libc/sysdeps/linux/x86_64/bits/mathdef.h	(revision 25552)
   1.311 ++++ uClibc-0.9.30.1/libc/sysdeps/linux/x86_64/bits/mathdef.h	(working copy)
   1.312 +@@ -46,3 +46,7 @@ typedef long double double_t;	/* `double
   1.313 + # define FP_ILOGBNAN	(-2147483647 - 1)
   1.314 + 
   1.315 + #endif	/* ISO C99 */
   1.316 ++
   1.317 ++#if !defined __NO_LONG_DOUBLE_MATH && !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
   1.318 ++# define __NO_LONG_DOUBLE_MATH	1
   1.319 ++#endif
   1.320 +Index: uClibc-0.9.30.1/libc/sysdeps/linux/xtensa/bits/mathdef.h
   1.321 +===================================================================
   1.322 +--- uClibc-0.9.30.1/libc/sysdeps/linux/xtensa/bits/mathdef.h	(revision 25552)
   1.323 ++++ uClibc-0.9.30.1/libc/sysdeps/linux/xtensa/bits/mathdef.h	(working copy)
   1.324 +@@ -36,8 +36,8 @@ typedef double double_t;	/* `double' exp
   1.325 + 
   1.326 + #endif	/* ISO C99 */
   1.327 + 
   1.328 +-#if defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
   1.329 ++#ifndef __NO_LONG_DOUBLE_MATH
   1.330 + /* Signal that we do not really have a `long double'.  The disables the
   1.331 +    declaration of all the `long double' function variants.  */
   1.332 +-# undef __UCLIBC_HAS_LONG_DOUBLE_MATH__
   1.333 ++# define __NO_LONG_DOUBLE_MATH	1
   1.334 + #endif
   1.335 +Index: uClibc-0.9.30.1/libc/sysdeps/linux/ia64/bits/mathdef.h
   1.336 +===================================================================
   1.337 +--- uClibc-0.9.30.1/libc/sysdeps/linux/ia64/bits/mathdef.h	(revision 25552)
   1.338 ++++ uClibc-0.9.30.1/libc/sysdeps/linux/ia64/bits/mathdef.h	(working copy)
   1.339 +@@ -35,3 +35,7 @@ typedef double double_t;	/* `double' exp
   1.340 + # define FP_ILOGBNAN	2147483647
   1.341 + 
   1.342 + #endif	/* ISO C99 */
   1.343 ++
   1.344 ++#if !defined __NO_LONG_DOUBLE_MATH && !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
   1.345 ++# define __NO_LONG_DOUBLE_MATH	1
   1.346 ++#endif
   1.347 +Index: uClibc-0.9.30.1/libc/sysdeps/linux/mips/bits/mathdef.h
   1.348 +===================================================================
   1.349 +--- uClibc-0.9.30.1/libc/sysdeps/linux/mips/bits/mathdef.h	(revision 25552)
   1.350 ++++ uClibc-0.9.30.1/libc/sysdeps/linux/mips/bits/mathdef.h	(working copy)
   1.351 +@@ -39,8 +39,10 @@ typedef double double_t;	/* `double' exp
   1.352 + 
   1.353 + #endif	/* ISO C99 */
   1.354 + 
   1.355 +-#if defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ && _MIPS_SIM == _ABIO32
   1.356 ++#if ! defined __NO_LONG_DOUBLE_MATH && _MIPS_SIM == _ABIO32
   1.357 + /* Signal that we do not really have a `long double'.  This disables the
   1.358 +    declaration of all the `long double' function variants.  */
   1.359 +-# error defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ and _MIPS_SIM == _ABIO32
   1.360 ++# define __NO_LONG_DOUBLE_MATH	1
   1.361 ++#elif !defined __NO_LONG_DOUBLE_MATH && !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
   1.362 ++# define __NO_LONG_DOUBLE_MATH	1
   1.363 + #endif
   1.364 +Index: uClibc-0.9.30.1/libc/sysdeps/linux/nios/bits/mathdef.h
   1.365 +===================================================================
   1.366 +--- uClibc-0.9.30.1/libc/sysdeps/linux/nios/bits/mathdef.h	(revision 25552)
   1.367 ++++ uClibc-0.9.30.1/libc/sysdeps/linux/nios/bits/mathdef.h	(working copy)
   1.368 +@@ -34,3 +34,11 @@ typedef double double_t;	/* `double' exp
   1.369 + # define FP_ILOGBNAN	(2147483647)
   1.370 + 
   1.371 + #endif	/* ISO C99 */
   1.372 ++
   1.373 ++#ifndef __NO_LONG_DOUBLE_MATH
   1.374 ++/* Signal that we do not really have a `long double'.  This disables the
   1.375 ++   declaration of all the `long double' function variants.  */
   1.376 ++/* XXX The FPA does support this but the patterns in GCC are currently
   1.377 ++   turned off.  */
   1.378 ++# define __NO_LONG_DOUBLE_MATH	1
   1.379 ++#endif
   1.380 +Index: uClibc-0.9.30.1/libc/sysdeps/linux/sparc/bits/wordsize.h
   1.381 +===================================================================
   1.382 +--- uClibc-0.9.30.1/libc/sysdeps/linux/sparc/bits/wordsize.h	(revision 25552)
   1.383 ++++ uClibc-0.9.30.1/libc/sysdeps/linux/sparc/bits/wordsize.h	(working copy)
   1.384 +@@ -6,7 +6,7 @@
   1.385 + # define __WORDSIZE	32
   1.386 + #endif
   1.387 + 
   1.388 +-#if 0 /* uClibc: done in mathdefs.h: defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ && !defined __LONG_DOUBLE_MATH_OPTIONAL*/
   1.389 ++#if 0 /* uClibc: done in mathdefs.h: !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL*/
   1.390 + 
   1.391 + # if __WORDSIZE == 32
   1.392 + /* Signal that in 32bit ABI we didn't used to have a `long double'.
   1.393 +@@ -14,7 +14,7 @@
   1.394 +    to the double functions.  */
   1.395 + #  define __LONG_DOUBLE_MATH_OPTIONAL   1
   1.396 + #  ifndef __LONG_DOUBLE_128__
   1.397 +-#   undef __UCLIBC_HAS_LONG_DOUBLE_MATH__
   1.398 ++#   define __NO_LONG_DOUBLE_MATH        1
   1.399 + #  endif
   1.400 + # endif
   1.401 + #endif
   1.402 +Index: uClibc-0.9.30.1/libc/sysdeps/linux/sparc/bits/mathdef.h
   1.403 +===================================================================
   1.404 +--- uClibc-0.9.30.1/libc/sysdeps/linux/sparc/bits/mathdef.h	(revision 25552)
   1.405 ++++ uClibc-0.9.30.1/libc/sysdeps/linux/sparc/bits/mathdef.h	(working copy)
   1.406 +@@ -57,13 +57,15 @@ typedef double double_t;
   1.407 + 
   1.408 + #endif	/* ISO C99 */
   1.409 + 
   1.410 +-#ifdef __UCLIBC_HAS_LONG_DOUBLE_MATH__
   1.411 ++#ifndef __NO_LONG_DOUBLE_MATH
   1.412 + 
   1.413 + # if __WORDSIZE == 32
   1.414 + /* Signal that in 32bit ABI we do not really have a `long double'.
   1.415 +    The disables the declaration of all the `long double' function
   1.416 +    variants.  */
   1.417 +-#  undef __UCLIBC_HAS_LONG_DOUBLE_MATH__
   1.418 ++#  define __NO_LONG_DOUBLE_MATH	1
   1.419 ++# elif !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
   1.420 ++#  define __NO_LONG_DOUBLE_MATH	1
   1.421 + # endif
   1.422 + 
   1.423 + #endif
   1.424 +Index: uClibc-0.9.30.1/libc/sysdeps/linux/sparc/bits/mathinline.h
   1.425 +===================================================================
   1.426 +--- uClibc-0.9.30.1/libc/sysdeps/linux/sparc/bits/mathinline.h	(revision 25552)
   1.427 ++++ uClibc-0.9.30.1/libc/sysdeps/linux/sparc/bits/mathinline.h	(working copy)
   1.428 +@@ -37,7 +37,7 @@
   1.429 + 
   1.430 + # if __WORDSIZE == 32
   1.431 + 
   1.432 +-#  ifdef __UCLIBC_HAS_LONG_DOUBLE_MATH__
   1.433 ++#  ifndef __NO_LONG_DOUBLE_MATH
   1.434 + 
   1.435 + #   define __unordered_cmp(x, y) \
   1.436 +   (__extension__							      \
   1.437 +@@ -157,7 +157,7 @@ __NTH (__signbit (double __x))
   1.438 +   return __u.__i[0] < 0;
   1.439 + }
   1.440 + 
   1.441 +-#    ifdef __UCLIBC_HAS_LONG_DOUBLE_MATH__
   1.442 ++#    ifndef __NO_LONG_DOUBLE_MATH
   1.443 + __MATH_INLINE int
   1.444 + __NTH (__signbitl (long double __x))
   1.445 + {
   1.446 +@@ -219,7 +219,7 @@ __NTH (sqrtl (long double __x))
   1.447 +   _Qp_sqrt (&__r, &__x);
   1.448 +   return __r;
   1.449 + }
   1.450 +-#   elif defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
   1.451 ++#   elif !defined __NO_LONG_DOUBLE_MATH
   1.452 + __MATH_INLINE long double
   1.453 + sqrtl (long double __x) __THROW
   1.454 + {
   1.455 +@@ -257,7 +257,7 @@ __ieee754_sqrtl (long double __x)
   1.456 +   _Qp_sqrt(&__r, &__x);
   1.457 +   return __r;
   1.458 + }
   1.459 +-#   elif defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
   1.460 ++#   elif !defined __NO_LONG_DOUBLE_MATH
   1.461 + __MATH_INLINE long double
   1.462 + __ieee754_sqrtl (long double __x)
   1.463 + {
   1.464 +Index: uClibc-0.9.30.1/libc/sysdeps/linux/sh/bits/mathdef.h
   1.465 +===================================================================
   1.466 +--- uClibc-0.9.30.1/libc/sysdeps/linux/sh/bits/mathdef.h	(revision 25552)
   1.467 ++++ uClibc-0.9.30.1/libc/sysdeps/linux/sh/bits/mathdef.h	(working copy)
   1.468 +@@ -61,3 +61,9 @@ typedef double double_t;
   1.469 + # define FP_ILOGBNAN	0x7fffffff
   1.470 + 
   1.471 + #endif	/* ISO C99 */
   1.472 ++
   1.473 ++#ifndef __NO_LONG_DOUBLE_MATH
   1.474 ++/* Signal that we do not really have a `long double'.  The disables the
   1.475 ++   declaration of all the `long double' function variants.  */
   1.476 ++# define __NO_LONG_DOUBLE_MATH	1
   1.477 ++#endif