Add c symbols to std

This commit is contained in:
Nicolas Lemblé 2024-05-15 15:56:28 +02:00 committed by Alan Carvalho de Assis
parent c9170c3b0a
commit 03dbb82db9
3 changed files with 84 additions and 0 deletions

View File

@ -30,6 +30,12 @@
#include <math.h>
#undef signbit
#undef fpclassify
#undef isfinite
#undef isinf
#undef isnan
//***************************************************************************
// Namespace
//***************************************************************************
@ -54,6 +60,7 @@ namespace std
using ::frexpf;
using ::ldexpf;
using ::logf;
using ::log1pf;
using ::log10f;
using ::log2f;
using ::modff;
@ -66,6 +73,29 @@ namespace std
using ::tanhf;
using ::gamma;
using ::lgamma;
constexpr bool
signbit(float __x)
{ return __builtin_signbit(__x); }
constexpr int
fpclassify(float __x)
{ return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
FP_SUBNORMAL, FP_ZERO, __x); }
constexpr bool
isfinite(float __x)
{ return __builtin_isfinite(__x); }
constexpr bool
isinf(float __x)
{ return __builtin_isinf(__x); }
constexpr bool
isnan(float __x)
{ return __builtin_isnan(__x); }
#endif
#ifdef CONFIG_HAVE_DOUBLE
@ -83,6 +113,7 @@ namespace std
using ::frexp;
using ::ldexp;
using ::log;
using ::log1p;
using ::log10;
using ::log2;
using ::modf;
@ -93,6 +124,28 @@ namespace std
using ::sqrt;
using ::tan;
using ::tanh;
constexpr bool
signbit(double __x)
{ return __builtin_signbit(__x); }
constexpr int
fpclassify(double __x)
{ return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
FP_SUBNORMAL, FP_ZERO, __x); }
constexpr bool
isfinite(double __x)
{ return __builtin_isfinite(__x); }
constexpr bool
isinf(double __x)
{ return __builtin_isinf(__x); }
constexpr bool
isnan(double __x)
{ return __builtin_isnan(__x); }
#endif
#ifdef CONFIG_HAVE_LONG_DOUBLE
@ -110,6 +163,7 @@ namespace std
using ::frexpl;
using ::ldexpl;
using ::logl;
using ::log1pl;
using ::log10l;
using ::log2l;
using ::modfl;
@ -120,6 +174,28 @@ namespace std
using ::sqrtl;
using ::tanl;
using ::tanhl;
constexpr bool
signbit(long double __x)
{ return __builtin_signbit(__x); }
constexpr int
fpclassify(long double __x)
{ return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
FP_SUBNORMAL, FP_ZERO, __x); }
constexpr bool
isfinite(long double __x)
{ return __builtin_isfinite(__x); }
constexpr bool
isinf(long double __x)
{ return __builtin_isinf(__x); }
constexpr bool
isnan(long double __x)
{ return __builtin_isnan(__x); }
#endif
}

View File

@ -27,8 +27,14 @@
#include <stdarg.h>
//***************************************************************************
// Namespace
//***************************************************************************
namespace std
{
using ::va_list;
}
#endif // __INCLUDE_CXX_CSTDARG

View File

@ -45,6 +45,8 @@ namespace std
using ::clock_gettime;
using ::mktime;
using ::gmtime_r;
using ::gmtime;
using ::strftime;
using ::timer_create;
using ::timer_delete;
using ::timer_settime;