[OpenWrt-Devel] [PATCH] Do not define functions which are not implemented

Cristian Morales Vega cristian at samknows.com
Tue Sep 23 08:00:53 EDT 2014


e.g. fminf() is not implemented by uClibc, only fmin(), but both are defined.

Signed-off-by: Cristian Morales Vega <cristian at samknows.com>
---
 .../995-no_implemenation_no_define.patch           | 96 ++++++++++++++++++++++
 1 file changed, 96 insertions(+)
 create mode 100644 toolchain/uClibc/patches-0.9.33.2/995-no_implemenation_no_define.patch

diff --git a/toolchain/uClibc/patches-0.9.33.2/995-no_implemenation_no_define.patch b/toolchain/uClibc/patches-0.9.33.2/995-no_implemenation_no_define.patch
new file mode 100644
index 0000000..07e8ef8
--- /dev/null
+++ b/toolchain/uClibc/patches-0.9.33.2/995-no_implemenation_no_define.patch
@@ -0,0 +1,96 @@
+--- a/include/math.h
++++ b/include/math.h
+@@ -119,6 +119,7 @@ __BEGIN_DECLS
+ #  define _Mfloat_		float
+ # endif
+ # define _Mdouble_		_Mfloat_
++# define _Mdouble_is_float_
+ # ifdef __STDC__
+ #  define __MATH_PRECNAME(name,r) name##f##r
+ # else
+@@ -127,6 +128,7 @@ __BEGIN_DECLS
+ # define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_C99
+ # define _Mdouble_END_NAMESPACE   __END_NAMESPACE_C99
+ # include <bits/mathcalls.h>
++# undef _Mdouble_is_float_
+ # undef	_Mdouble_
+ # undef _Mdouble_BEGIN_NAMESPACE
+ # undef _Mdouble_END_NAMESPACE
+--- a/libc/sysdeps/linux/common/bits/mathcalls.h
++++ b/libc/sysdeps/linux/common/bits/mathcalls.h
+@@ -272,7 +272,9 @@ __END_NAMESPACE_C99
+ #ifdef __USE_ISOC99
+ __BEGIN_NAMESPACE_C99
+ /* True gamma function.  */
++# ifndef _Mdouble_is_float_
+ __MATHCALLI (tgamma,, (_Mdouble_))
++# endif
+ __END_NAMESPACE_C99
+ #endif
+ 
+@@ -298,7 +300,9 @@ __MATHCALLI (rint,, (_Mdouble_ __x))
+ /* Return X + epsilon if X < Y, X - epsilon if X > Y.  */
+ __MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__))
+ # if defined __USE_ISOC99 && !defined __LDBL_COMPAT
++#  ifndef _Mdouble_is_float_
+ __MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__))
++#  endif
+ # endif
+ 
+ /* Return the remainder of integer divison X / Y with infinite precision.  */
+@@ -315,11 +319,15 @@ __MATHDECLI (int,ilogb,, (_Mdouble_ __x)
+ 
+ #ifdef __USE_ISOC99
+ /* Return X times (2 to the Nth power).  */
++# ifndef _Mdouble_is_float_
+ __MATHCALLI (scalbln,, (_Mdouble_ __x, long int __n))
++# endif
+ 
+ /* Round X to integral value in floating-point format using current
+    rounding direction, but do not raise inexact exception.  */
++# ifndef _Mdouble_is_float_
+ __MATHCALLI (nearbyint,, (_Mdouble_ __x))
++# endif
+ 
+ /* Round X to nearest integral value, rounding halfway cases away from
+    zero.  */
+@@ -332,7 +340,9 @@ __MATHCALLX (trunc,, (_Mdouble_ __x), (_
+ /* Compute remainder of X and Y and put in *QUO a value with sign of x/y
+    and magnitude congruent `mod 2^n' to the magnitude of the integral
+    quotient x/y, with n >= 3.  */
++# ifndef _Mdouble_is_float_
+ __MATHCALLI (remquo,, (_Mdouble_ __x, _Mdouble_ __y, int *__quo))
++# endif
+ 
+ 
+ /* Conversion functions.  */
+@@ -349,13 +359,19 @@ __MATHDECLI (long long int,llround,, (_M
+ 
+ 
+ /* Return positive difference between X and Y.  */
++# ifndef _Mdouble_is_float_
+ __MATHCALLI (fdim,, (_Mdouble_ __x, _Mdouble_ __y))
++# endif
+ 
+ /* Return maximum numeric value from X and Y.  */
++# ifndef _Mdouble_is_float_
+ __MATHCALLI (fmax,, (_Mdouble_ __x, _Mdouble_ __y))
++# endif
+ 
+ /* Return minimum numeric value from X and Y.  */
++# ifndef _Mdouble_is_float_
+ __MATHCALLI (fmin,, (_Mdouble_ __x, _Mdouble_ __y))
++# endif
+ 
+ 
+ /* Classify given number.  */
+@@ -366,7 +382,9 @@ __MATHDECL_PRIV (int, signbit,, (_Mdoubl
+ 
+ 
+ /* Multiply-add function computed as a ternary operation.  */
++# ifndef _Mdouble_is_float_
+ __MATHCALLI (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z))
++# endif
+ #endif /* Use ISO C99.  */
+ 
+ #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
-- 
1.9.3
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list