Remove some legacy declarations from <math.h>.

These are still needed for backwards compatibility with code built by old
versions of the NDK, but we don't need to pollute the headers with them.

Also lose the hand-written code for these. The compiler-generated code
is either the same or better, and no new code is calling these functions
anyway.

Bug: N/A
Test: ran tests
Change-Id: Ib01ad9805034433e0105aec882608cc8e6526f78
diff --git a/tests/math_test.cpp b/tests/math_test.cpp
index 0fc4e50..466e697 100644
--- a/tests/math_test.cpp
+++ b/tests/math_test.cpp
@@ -176,6 +176,11 @@
   ASSERT_NE(0, test_capture_signbit(-1.0L));
 }
 
+// Historical BSD cruft that isn't exposed in <math.h> any more.
+extern "C" int __fpclassifyd(double);
+extern "C" int __fpclassifyf(float);
+extern "C" int __fpclassifyl(long double);
+
 TEST(MATH_TEST, __fpclassifyd) {
 #if defined(__GLIBC__)
 #define __fpclassifyd __fpclassify
@@ -208,6 +213,11 @@
   ASSERT_FALSE(finitef(HUGE_VALF));
 }
 
+// Historical BSD cruft that isn't exposed in <math.h> any more.
+extern "C" int __isfinite(double);
+extern "C" int __isfinitef(float);
+extern "C" int __isfinitel(long double);
+
 TEST(MATH_TEST, __isfinite) {
 #if defined(__GLIBC__)
 #define __isfinite __finite
@@ -243,6 +253,10 @@
   ASSERT_TRUE((isinf)(HUGE_VAL));
 }
 
+// Historical BSD cruft that isn't exposed in <math.h> any more.
+extern "C" int __isinff(float);
+extern "C" int __isinfl(long double);
+
 TEST(MATH_TEST, __isinff) {
   ASSERT_FALSE(__isinff(123.0f));
   ASSERT_TRUE(__isinff(HUGE_VALF));
@@ -259,6 +273,10 @@
   ASSERT_TRUE((isnan)(nan("")));
 }
 
+// Historical BSD cruft that isn't exposed in <math.h> any more.
+extern "C" int __isnanf(float);
+extern "C" int __isnanl(long double);
+
 TEST(MATH_TEST, __isnanf) {
   ASSERT_FALSE(__isnanf(123.0f));
   ASSERT_TRUE(__isnanf(nanf("")));
@@ -274,6 +292,11 @@
   ASSERT_TRUE(isnanf(nanf("")));
 }
 
+// Historical BSD cruft that isn't exposed in <math.h> any more.
+extern "C" int __isnormal(double);
+extern "C" int __isnormalf(float);
+extern "C" int __isnormall(long double);
+
 TEST(MATH_TEST, __isnormal) {
 #if defined(__BIONIC__)
   ASSERT_TRUE(__isnormal(123.0));
@@ -301,6 +324,11 @@
 #endif // __BIONIC__
 }
 
+// Historical BSD cruft that isn't exposed in <math.h> any more.
+extern "C" int __signbit(double);
+extern "C" int __signbitf(float);
+extern "C" int __signbitl(long double);
+
 TEST(MATH_TEST, __signbit) {
   ASSERT_EQ(0, __signbit(0.0));
   ASSERT_EQ(0, __signbit(1.0));