[git commit] cmath: respect __CORRECT_ISO_CPP_MATH_H_PROTO

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Fri May 25 20:21:16 UTC 2012


commit: http://git.uclibc.org/uClibc++/commit/?id=1eb3bb2af59a2abfb400dda0a639c59afcf490e2
branch: http://git.uclibc.org/uClibc++/commit/?id=refs/heads/master

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
---
 include/cmath |   35 ++++++++++++++++++++++++++++++++---
 1 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/include/cmath b/include/cmath
index 29def58..5409e64 100644
--- a/include/cmath
+++ b/include/cmath
@@ -22,7 +22,32 @@
 #ifndef __STD_HEADER_CMATH
 #define __STD_HEADER_CMATH 1
 
-namespace std{
+#undef abs
+#undef acos
+#undef asin
+#undef atan
+#undef atan2
+#undef ceil
+#undef cos
+#undef cosh
+#undef exp
+#undef fabs
+#undef floor
+#undef fmod
+#undef frexp
+#undef ldexp
+#undef log
+#undef log10
+#undef modf
+#undef pow
+#undef sin
+#undef sinh
+#undef sqrt
+#undef tan
+#undef tanh
+
+namespace std {
+
 	using ::acos;
 	using ::asin;
 	using ::atan;
@@ -46,6 +71,7 @@ namespace std{
 	using ::tan;
 	using ::tanh;
 
+#ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
 	inline float abs  (float x){
 		return fabsf(x);
 	}
@@ -100,9 +126,11 @@ namespace std{
 	inline float pow  (float x, float y){
 		return powf(x, y);
 	}
+#if 1 // DR 550 removed this
 	inline float pow  (float x, int y){
 		return pow((double)x, (double)y);
 	}
+#endif
 	inline float sin  (float x){
 		return sinf(x);
 	}
@@ -125,7 +153,7 @@ namespace std{
 		return pow((double)x, (double)y);
 	}
 
-#ifdef __UCLIBCXX_HAS_LONG_DOUBLE__
+# ifdef __UCLIBCXX_HAS_LONG_DOUBLE__
 	inline long double abs  (long double x){
 		return fabsl(x);
 	}
@@ -198,7 +226,8 @@ namespace std{
 	inline long double tanh (long double x){
 		return tanhl(x);
 	}
-#endif	//	 __UCLIBCXX_HAS_LONG_DOUBLE__
+# endif	//	 __UCLIBCXX_HAS_LONG_DOUBLE__
+#endif	//	 __CORRECT_ISO_CPP_MATH_H_PROTO
 }
 
 #endif	//__STD_HEADER_CMATH


More information about the uClibc-cvs mailing list