File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -611,8 +611,49 @@ _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
629+
614630#if __cplusplus >= 201103L
615631
632+ #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
633+ constexpr int
634+ fpclassify (float __x)
635+ { return __builtin_fpclassify (FP_NAN, FP_INFINITE, FP_NORMAL,
636+ FP_SUBNORMAL, FP_ZERO, __x); }
637+
638+ constexpr int
639+ fpclassify (double __x)
640+ { return __builtin_fpclassify (FP_NAN, FP_INFINITE, FP_NORMAL,
641+ FP_SUBNORMAL, FP_ZERO, __x); }
642+
643+ constexpr int
644+ fpclassify (long double __x)
645+ { return __builtin_fpclassify (FP_NAN, FP_INFINITE, FP_NORMAL,
646+ FP_SUBNORMAL, FP_ZERO, __x); }
647+ #endif
648+
649+ #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
650+ template <typename _Tp>
651+ constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
652+ int >::__type
653+ fpclassify (_Tp __x)
654+ { return __x != 0 ? FP_NORMAL : FP_ZERO; }
655+ #endif
656+
616657#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
617658 constexpr bool
618659 isfinite (float __x)
You can’t perform that action at this time.
0 commit comments