Skip to content

Commit 5a4c53d

Browse files
chris-durandsalkinium
authored andcommitted
Remove C99 features not supported by avr-libc
1 parent 0b52533 commit 5a4c53d

File tree

4 files changed

+13
-224
lines changed

4 files changed

+13
-224
lines changed

include/cinttypes

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -50,32 +50,6 @@
5050
# endif
5151
#endif
5252

53-
#ifdef _GLIBCXX_USE_C99_INTTYPES_TR1
54-
55-
namespace std
56-
{
57-
// types
58-
using ::imaxdiv_t;
59-
60-
// functions
61-
using ::imaxabs;
62-
using ::imaxdiv;
63-
64-
// GCC does not support extended integer types
65-
// intmax_t abs(intmax_t)
66-
// imaxdiv_t div(intmax_t, intmax_t)
67-
68-
using ::strtoimax;
69-
using ::strtoumax;
70-
71-
#if defined(_GLIBCXX_USE_WCHAR_T) && _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1
72-
using ::wcstoimax;
73-
using ::wcstoumax;
74-
#endif
75-
} // namespace std
76-
77-
#endif // _GLIBCXX_USE_C99_INTTYPES_TR1
78-
7953
#endif // C++11
8054

8155
#endif // _GLIBCXX_CINTTYPES

include/cmath

Lines changed: 13 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -532,31 +532,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
532532

533533
#if __cplusplus >= 201103L
534534

535-
#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
536-
constexpr int
537-
fpclassify(float __x)
538-
{ return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
539-
FP_SUBNORMAL, FP_ZERO, __x); }
540-
541-
constexpr int
542-
fpclassify(double __x)
543-
{ return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
544-
FP_SUBNORMAL, FP_ZERO, __x); }
545-
546-
constexpr int
547-
fpclassify(long double __x)
548-
{ return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
549-
FP_SUBNORMAL, FP_ZERO, __x); }
550-
#endif
551-
552-
#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
553-
template<typename _Tp>
554-
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
555-
int>::__type
556-
fpclassify(_Tp __x)
557-
{ return __x != 0 ? FP_NORMAL : FP_ZERO; }
558-
#endif
559-
560535
#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
561536
constexpr bool
562537
isfinite(float __x)
@@ -1062,73 +1037,31 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
10621037
#undef truncl
10631038

10641039
// types
1065-
using ::double_t;
1066-
using ::float_t;
1040+
using double_t = double;
1041+
using float_t = float;
10671042

10681043
// functions
1069-
using ::acosh;
1070-
using ::acoshf;
1071-
using ::acoshl;
1072-
1073-
using ::asinh;
1074-
using ::asinhf;
1075-
using ::asinhl;
1076-
1077-
using ::atanh;
1078-
using ::atanhf;
1079-
using ::atanhl;
10801044

10811045
using ::cbrt;
1082-
using ::cbrtf;
1083-
using ::cbrtl;
1046+
inline float cbrtf(float __x) { return ::cbrt(__x); }
10841047

10851048
using ::copysign;
1086-
using ::copysignf;
1087-
using ::copysignl;
1088-
1089-
using ::erf;
1090-
using ::erff;
1091-
using ::erfl;
1092-
1093-
using ::erfc;
1094-
using ::erfcf;
1095-
using ::erfcl;
1096-
1097-
using ::exp2;
1098-
using ::exp2f;
1099-
using ::exp2l;
1100-
1101-
using ::expm1;
1102-
using ::expm1f;
1103-
using ::expm1l;
1049+
inline float copysignf(float __x, float __y) { return ::copysign(__x, __y); }
11041050

11051051
using ::fdim;
1106-
using ::fdimf;
1107-
using ::fdiml;
1052+
inline float fdimf(float __x, float __y) { return ::fdim(__x, __y); }
11081053

11091054
using ::fma;
1110-
using ::fmaf;
1111-
using ::fmal;
1055+
inline float fmaf(float __x, float __y, float __z) { return ::fma(__x, __y, __z); }
11121056

11131057
using ::fmax;
1114-
using ::fmaxf;
1115-
using ::fmaxl;
1058+
inline float fmaxf(float __x, float __y) { return ::fmax(__x, __y); }
11161059

11171060
using ::fmin;
1118-
using ::fminf;
1119-
using ::fminl;
1061+
inline float fminf(float __x, float __y) { return ::fmin(__x, __y); }
11201062

11211063
using ::hypot;
1122-
using ::hypotf;
1123-
using ::hypotl;
1124-
1125-
using ::ilogb;
1126-
using ::ilogbf;
1127-
using ::ilogbl;
1128-
1129-
using ::lgamma;
1130-
using ::lgammaf;
1131-
using ::lgammal;
1064+
inline float hypotf(float __x, float __y) { return ::hypot(__x, __y); }
11321065

11331066
#ifndef _GLIBCXX_NO_C99_ROUNDING_FUNCS
11341067
using ::llrint;
@@ -1140,73 +1073,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
11401073
using ::llroundl;
11411074
#endif
11421075

1143-
using ::log1p;
1144-
using ::log1pf;
1145-
using ::log1pl;
1146-
1147-
using ::log2;
1148-
using ::log2f;
1149-
using ::log2l;
1150-
1151-
using ::logb;
1152-
using ::logbf;
1153-
using ::logbl;
1154-
11551076
using ::lrint;
1156-
using ::lrintf;
1157-
using ::lrintl;
1077+
inline float lrintf(float __x) { return ::lrint(__x); }
11581078

11591079
using ::lround;
1160-
using ::lroundf;
1161-
using ::lroundl;
1162-
1163-
using ::nan;
1164-
using ::nanf;
1165-
using ::nanl;
1166-
1167-
using ::nearbyint;
1168-
using ::nearbyintf;
1169-
using ::nearbyintl;
1170-
1171-
using ::nextafter;
1172-
using ::nextafterf;
1173-
using ::nextafterl;
1174-
1175-
using ::nexttoward;
1176-
using ::nexttowardf;
1177-
using ::nexttowardl;
1178-
1179-
using ::remainder;
1180-
using ::remainderf;
1181-
using ::remainderl;
1182-
1183-
using ::remquo;
1184-
using ::remquof;
1185-
using ::remquol;
1186-
1187-
using ::rint;
1188-
using ::rintf;
1189-
using ::rintl;
1080+
inline float lroundf(float __x) { return ::lround(__x); }
11901081

11911082
using ::round;
1192-
using ::roundf;
1193-
using ::roundl;
1194-
1195-
using ::scalbln;
1196-
using ::scalblnf;
1197-
using ::scalblnl;
1198-
1199-
using ::scalbn;
1200-
using ::scalbnf;
1201-
using ::scalbnl;
1202-
1203-
using ::tgamma;
1204-
using ::tgammaf;
1205-
using ::tgammal;
1083+
inline float roundf(float __x) { return ::round(__x); }
12061084

12071085
using ::trunc;
1208-
using ::truncf;
1209-
using ::truncl;
1086+
inline float truncf(float __x) { return ::trunc(__x); }
12101087

12111088
/// Additional overloads.
12121089
#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP

include/cstdio

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ namespace __gnu_cxx
176176
using ::vfscanf;
177177
using ::vscanf;
178178
using ::vsnprintf;
179-
using ::vsscanf;
180179
#endif
181180
} // namespace __gnu_cxx
182181

@@ -186,7 +185,6 @@ namespace std
186185
using ::__gnu_cxx::vfscanf;
187186
using ::__gnu_cxx::vscanf;
188187
using ::__gnu_cxx::vsnprintf;
189-
using ::__gnu_cxx::vsscanf;
190188
} // namespace std
191189

192190
#endif // _GLIBCXX_USE_C99_STDIO

include/cstdlib

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -192,66 +192,6 @@ _GLIBCXX_END_NAMESPACE_VERSION
192192
#undef strtof
193193
#undef strtold
194194

195-
namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
196-
{
197-
_GLIBCXX_BEGIN_NAMESPACE_VERSION
198-
199-
#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
200-
using ::lldiv_t;
201-
#endif
202-
#if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
203-
extern "C" void (_Exit)(int) throw () _GLIBCXX_NORETURN;
204-
#endif
205-
#if !_GLIBCXX_USE_C99_DYNAMIC
206-
using ::_Exit;
207-
#endif
208-
209-
#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
210-
using ::llabs;
211-
212-
inline lldiv_t
213-
div(long long __n, long long __d)
214-
{ lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
215-
216-
using ::lldiv;
217-
#endif
218-
219-
#if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
220-
extern "C" long long int (atoll)(const char *) throw ();
221-
extern "C" long long int
222-
(strtoll)(const char * __restrict, char ** __restrict, int) throw ();
223-
extern "C" unsigned long long int
224-
(strtoull)(const char * __restrict, char ** __restrict, int) throw ();
225-
#endif
226-
#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
227-
using ::atoll;
228-
using ::strtoll;
229-
using ::strtoull;
230-
#endif
231-
using ::strtof;
232-
using ::strtold;
233-
234-
_GLIBCXX_END_NAMESPACE_VERSION
235-
} // namespace __gnu_cxx
236-
237-
namespace std
238-
{
239-
#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
240-
using ::__gnu_cxx::lldiv_t;
241-
#endif
242-
using ::__gnu_cxx::_Exit;
243-
#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
244-
using ::__gnu_cxx::llabs;
245-
using ::__gnu_cxx::div;
246-
using ::__gnu_cxx::lldiv;
247-
#endif
248-
using ::__gnu_cxx::atoll;
249-
using ::__gnu_cxx::strtof;
250-
using ::__gnu_cxx::strtoll;
251-
using ::__gnu_cxx::strtoull;
252-
using ::__gnu_cxx::strtold;
253-
} // namespace std
254-
255195
#endif // _GLIBCXX_USE_C99_STDLIB
256196

257197
} // extern "C++"

0 commit comments

Comments
 (0)