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> #include <math.h>
#undef signbit
#undef fpclassify
#undef isfinite
#undef isinf
#undef isnan
//*************************************************************************** //***************************************************************************
// Namespace // Namespace
//*************************************************************************** //***************************************************************************
@ -54,6 +60,7 @@ namespace std
using ::frexpf; using ::frexpf;
using ::ldexpf; using ::ldexpf;
using ::logf; using ::logf;
using ::log1pf;
using ::log10f; using ::log10f;
using ::log2f; using ::log2f;
using ::modff; using ::modff;
@ -66,6 +73,29 @@ namespace std
using ::tanhf; using ::tanhf;
using ::gamma; using ::gamma;
using ::lgamma; 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 #endif
#ifdef CONFIG_HAVE_DOUBLE #ifdef CONFIG_HAVE_DOUBLE
@ -83,6 +113,7 @@ namespace std
using ::frexp; using ::frexp;
using ::ldexp; using ::ldexp;
using ::log; using ::log;
using ::log1p;
using ::log10; using ::log10;
using ::log2; using ::log2;
using ::modf; using ::modf;
@ -93,6 +124,28 @@ namespace std
using ::sqrt; using ::sqrt;
using ::tan; using ::tan;
using ::tanh; 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 #endif
#ifdef CONFIG_HAVE_LONG_DOUBLE #ifdef CONFIG_HAVE_LONG_DOUBLE
@ -110,6 +163,7 @@ namespace std
using ::frexpl; using ::frexpl;
using ::ldexpl; using ::ldexpl;
using ::logl; using ::logl;
using ::log1pl;
using ::log10l; using ::log10l;
using ::log2l; using ::log2l;
using ::modfl; using ::modfl;
@ -120,6 +174,28 @@ namespace std
using ::sqrtl; using ::sqrtl;
using ::tanl; using ::tanl;
using ::tanhl; 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 #endif
} }

View File

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

View File

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