File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -611,8 +611,48 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
611611#undef islessgreater
612612#undef isunordered
613613
614+ #if !defined(FP_NAN)
615+ #define FP_NAN 0
616+ #endif
617+ #if !defined(FP_INFINITE)
618+ #define FP_INFINITE 1
619+ #endif
620+ #if !defined(FP_ZERO)
621+ #define FP_ZERO 2
622+ #endif
623+ #if !defined(FP_SUBNORMAL)
624+ #define FP_SUBNORMAL 3
625+ #endif
626+ #if !defined(FP_NORMAL)
627+ #define FP_NORMAL 4
628+ #endif
614629#if __cplusplus >= 201103L
615630
631+ #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
632+ constexpr int
633+ fpclassify (float __x)
634+ { return __builtin_fpclassify (FP_NAN, FP_INFINITE, FP_NORMAL,
635+ FP_SUBNORMAL, FP_ZERO, __x); }
636+
637+ constexpr int
638+ fpclassify (double __x)
639+ { return __builtin_fpclassify (FP_NAN, FP_INFINITE, FP_NORMAL,
640+ FP_SUBNORMAL, FP_ZERO, __x); }
641+
642+ constexpr int
643+ fpclassify (long double __x)
644+ { return __builtin_fpclassify (FP_NAN, FP_INFINITE, FP_NORMAL,
645+ FP_SUBNORMAL, FP_ZERO, __x); }
646+ #endif
647+
648+ #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
649+ template <typename _Tp>
650+ constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
651+ int >::__type
652+ fpclassify (_Tp __x)
653+ { return __x != 0 ? FP_NORMAL : FP_ZERO; }
654+ #endif
655+
616656#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
617657 constexpr bool
618658 isfinite (float __x)
You can’t perform that action at this time.
0 commit comments