summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3/include/c_std/bits/std_cmath.h
diff options
context:
space:
mode:
authorbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2001-04-20 08:59:25 +0000
committerbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2001-04-20 08:59:25 +0000
commit08078d479d75da325e154dc46441ac79949a35c2 (patch)
treef895b431b6a7bf322998be355dddd14b09763a4b /libstdc++-v3/include/c_std/bits/std_cmath.h
parenta3ad289ca1bfeaa87fe51b73353bf5e385a50b34 (diff)
downloadppe42-gcc-08078d479d75da325e154dc46441ac79949a35c2.tar.gz
ppe42-gcc-08078d479d75da325e154dc46441ac79949a35c2.zip
2001-04-19 Benjamin Kosnik <bkoz@redhat.com>
* acconfig.h (_GLIBCPP_USE_C99): Add. * config.h.in: Regenerate. * acinclude.m4 (GLIBCPP_ENABLE_C99): New macro. Test for ISO/IEC 9899: 1999 support. * aclocal.m4: Regenerate. * configure.in (GLIBCPP_ENABLE_C99): Use it, on by default. * configure: Regenerate. * configure.in (GLIBCPP_ENABLE_LONG_LONG): Set default to yes. * configure: Regenerate. * include/c_std/bits/std_cwchar.h: Put wcstold, wcstoll, wcstoull into c99. * include/c_std/bits/std_cmath.h: Bring C99 functions into c99 namespace. * include/c_std/bits/std_cstdlib.h: Same. * docs/html/configopts.html: Update. * testsuite/26_numerics/c99_macros.cc: Edit, use cmath instead of math.h (test_c99_classify): Add. * config/os/gnu-linux/bits/os_defines.h (_GNU_SOURCE): Remove. (_ISOC99_SOURCE): Remove. * include/bits/stl_algo.h: Use _GLIBCPP_HAVE_DRAND48. * include/bits/c++config (__STL_ASSERTIONS): Simplify. * acinclude.m4 (GLIBCPP_CHECK_STDLIB_SUPPORT): Add check for drand48. * aclocal.m4: Regenerate. * configure: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41451 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/c_std/bits/std_cmath.h')
-rw-r--r--libstdc++-v3/include/c_std/bits/std_cmath.h148
1 files changed, 130 insertions, 18 deletions
diff --git a/libstdc++-v3/include/c_std/bits/std_cmath.h b/libstdc++-v3/include/c_std/bits/std_cmath.h
index db3e47f6f20..9ec828493e6 100644
--- a/libstdc++-v3/include/c_std/bits/std_cmath.h
+++ b/libstdc++-v3/include/c_std/bits/std_cmath.h
@@ -67,24 +67,6 @@
#undef tan
#undef tanh
-// These are possible macros imported from C99-land. They tend to break
-// well-formed C++ programs. Just pretend we don't know about them.
-// At some point, we should provide extensions in std:: -- Gaby
-
-#undef fpclassify
-#undef isfinite
-#undef isinf
-#undef isnan
-#undef isnormal
-#undef signbit
-
-#undef isgreater
-#undef isgreaterequal
-#undef isless
-#undef islessequal
-#undef islessgreater
-#undef isunordered
-
namespace std
{
// Forward declaration of a helper function. This really should be
@@ -619,6 +601,136 @@ namespace std
#endif
} // std
+
+#if _GLIBCPP_USE_C99
+// These are possible macros imported from C99-land. For strict
+// conformance, remove possible C99-injected names from the
+// global namespace, and sequester them in the c99 namespace.
+namespace c99
+{
+ template<typename _Tp>
+ int
+ __capture_fpclassify(_Tp __f) { return fpclassify(__f); }
+
+ template<typename _Tp>
+ int
+ __capture_isfinite(_Tp __f) { return isfinite(__f); }
+
+ template<typename _Tp>
+ int
+ __capture_isinf(_Tp __f) { return isinf(__f); }
+
+ template<typename _Tp>
+ int
+ __capture_isnan(_Tp __f) { return isnan(__f); }
+
+ template<typename _Tp>
+ int
+ __capture_isnormal(_Tp __f) { return isnormal(__f); }
+
+ template<typename _Tp>
+ int
+ __capture_signbit(_Tp __f) { return signbit(__f); }
+
+ template<typename _Tp>
+ int
+ __capture_isgreater(_Tp __f1, _Tp __f2) { return isgreater(__f1, __f2); }
+
+ template<typename _Tp>
+ int
+ __capture_isgreaterequal(_Tp __f1, _Tp __f2)
+ { return isgreaterequal(__f1, __f2); }
+
+ template<typename _Tp>
+ int
+ __capture_isless(_Tp __f1, _Tp __f2) { return isless(__f1, __f2); }
+
+ template<typename _Tp>
+ int
+ __capture_islessequal(_Tp __f1, _Tp __f2)
+ { return islessequal(__f1, __f2); }
+
+ template<typename _Tp>
+ int
+ __capture_islessgreater(_Tp __f1, _Tp __f2)
+ { return islessgreater(__f1, __f2); }
+
+ template<typename _Tp>
+ int
+ __capture_isunordered(_Tp __f1, _Tp __f2)
+ { return isunordered(__f1, __f2); }
+} // namespace c99
+#endif
+
+#undef fpclassify
+#undef isfinite
+#undef isinf
+#undef isnan
+#undef isnormal
+#undef signbit
+#undef isgreater
+#undef isgreaterequal
+#undef isless
+#undef islessequal
+#undef islessgreater
+#undef isunordered
+
+#if _GLIBCPP_USE_C99
+namespace c99
+{
+ template<typename _Tp>
+ int
+ fpclassify(_Tp __f) { return __capture_fpclassify(__f); }
+
+ template<typename _Tp>
+ int
+ isfinite(_Tp __f) { return __capture_isfinite(__f); }
+
+ template<typename _Tp>
+ int
+ isinf(_Tp __f) { return __capture_isinf(__f); }
+
+ template<typename _Tp>
+ int
+ isnan(_Tp __f) { return __capture_isnan(__f); }
+
+ template<typename _Tp>
+ int
+ isnormal(_Tp __f) { return __capture_isnormal(__f); }
+
+ template<typename _Tp>
+ int
+ signbit(_Tp __f) { return __capture_signbit(__f); }
+
+ template<typename _Tp>
+ int
+ isgreater(_Tp __f1, _Tp __f2) { return __capture_isgreater(__f1, __f2); }
+
+ template<typename _Tp>
+ int
+ isgreaterequal(_Tp __f1, _Tp __f2)
+ { return __capture_isgreaterequal(__f1, __f2); }
+
+ template<typename _Tp>
+ int
+ isless(_Tp __f1, _Tp __f2) { return __capture_isless(__f1, __f2); }
+
+ template<typename _Tp>
+ int
+ islessequal(_Tp __f1, _Tp __f2)
+ { return __capture_islessequal(__f1, __f2); }
+
+ template<typename _Tp>
+ int
+ islessgreater(_Tp __f) { return __capture_islessgreater(__f); }
+
+ template<typename _Tp>
+ int
+ isunordered(_Tp __f1, _Tp __f2)
+ { return __capture_isunordered(__f1, __f2); }
+}
+#endif
+
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
# define export
# include <bits/cmath.tcc>
OpenPOWER on IntegriCloud