Skip to content

Commit 9427556

Browse files
committed
added more to <type_traits> and fixed src/libcxx whitespace
1 parent 17a1bfa commit 9427556

File tree

13 files changed

+987
-937
lines changed

13 files changed

+987
-937
lines changed

src/libcxx/abort_message.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ __BEGIN_DECLS
2020
void __abort_message(const char *) __attribute__((noreturn));
2121

2222
__END_DECLS
23-
__END_DECLS
23+
24+
} // namespace std
2425

2526
#endif // _EZCXX_ABORT_MESSAGE_H

src/libcxx/include/__abs_overloads

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,54 @@
1-
// -*- C++ -*-
2-
#ifndef _EZCXX_ABS_OVERLOADS
3-
#define _EZCXX_ABS_OVERLOADS
4-
5-
#include <cdefs.h>
6-
7-
#pragma clang system_header
8-
9-
// https://cplusplus.github.io/LWG/issue2192
10-
11-
#ifndef _ABS_INT_DEFINED
12-
#define _ABS_INT_DEFINED
13-
14-
__BEGIN_DECLS
15-
16-
int abs(int n);
17-
long labs(long n);
18-
long long llabs(long long n);
19-
20-
#ifdef __SIZEOF_INT48__
21-
signed __int48 i48abs(signed __int48 n) __NOEXCEPT_CONST;
22-
#endif // __SIZEOF_INT48__
23-
24-
__END_DECLS
25-
26-
#endif // _ABS_INT_DEFINED
27-
28-
#ifndef _ABS_FLOAT_DEFINED
29-
#define _ABS_FLOAT_DEFINED
30-
31-
extern "C" {
32-
float fabsf(float);
33-
double fabs(double);
34-
long double fabsl(long double);
35-
} // extern "C"
36-
37-
#endif // _ABS_FLOAT_DEFINED
38-
39-
namespace std {
40-
using ::abs;
41-
inline constexpr long abs(long __x) { return labs(__x); }
42-
inline constexpr long long abs(long long __x) { return llabs(__x); }
43-
44-
#ifdef __SIZEOF_INT48__
45-
using ::i48abs;
46-
inline signed __int48 abs(signed __int48 __x) { return i48abs(__x); }
47-
#endif // __SIZEOF_INT48__
48-
49-
inline constexpr float abs(float __x) { return fabsf(__x); }
50-
inline constexpr double abs(double __x) { return fabs(__x); }
51-
inline constexpr long double abs(long double __x) { return fabsl(__x); }
52-
}
53-
54-
#endif // _EZCXX_ABS_OVERLOADS
1+
// -*- C++ -*-
2+
#ifndef _EZCXX_ABS_OVERLOADS
3+
#define _EZCXX_ABS_OVERLOADS
4+
5+
#include <cdefs.h>
6+
7+
#pragma clang system_header
8+
9+
// https://cplusplus.github.io/LWG/issue2192
10+
11+
#ifndef _ABS_INT_DEFINED
12+
#define _ABS_INT_DEFINED
13+
14+
__BEGIN_DECLS
15+
16+
int abs(int n);
17+
long labs(long n);
18+
long long llabs(long long n);
19+
20+
#ifdef __SIZEOF_INT48__
21+
signed __int48 i48abs(signed __int48 n) __NOEXCEPT_CONST;
22+
#endif // __SIZEOF_INT48__
23+
24+
__END_DECLS
25+
26+
#endif // _ABS_INT_DEFINED
27+
28+
#ifndef _ABS_FLOAT_DEFINED
29+
#define _ABS_FLOAT_DEFINED
30+
31+
extern "C" {
32+
float fabsf(float);
33+
double fabs(double);
34+
long double fabsl(long double);
35+
} // extern "C"
36+
37+
#endif // _ABS_FLOAT_DEFINED
38+
39+
namespace std {
40+
using ::abs;
41+
inline constexpr long abs(long __x) { return labs(__x); }
42+
inline constexpr long long abs(long long __x) { return llabs(__x); }
43+
44+
#ifdef __SIZEOF_INT48__
45+
using ::i48abs;
46+
inline signed __int48 abs(signed __int48 __x) { return i48abs(__x); }
47+
#endif // __SIZEOF_INT48__
48+
49+
inline constexpr float abs(float __x) { return fabsf(__x); }
50+
inline constexpr double abs(double __x) { return fabs(__x); }
51+
inline constexpr long double abs(long double __x) { return fabsl(__x); }
52+
}
53+
54+
#endif // _EZCXX_ABS_OVERLOADS

src/libcxx/include/cmath

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ using ::nextupl;
637637
inline float nextup(float __x) { return nextupf(__x); }
638638
inline long double nextup(long double __x) { return nextupl(__x); }
639639
template<typename _Tp> inline
640-
__cmath_enable_if_t<__cmath_is_integral_v<_Tp>, double>
640+
__cmath_enable_if_t<__cmath_is_integral_v<_Tp>, double>
641641
nextup(_Tp __x) { return nextup(__x); }
642642

643643
using ::nexttoward;
@@ -655,7 +655,7 @@ using ::nextdownl;
655655
inline float nextdown(float __x) { return nextdownf(__x); }
656656
inline long double nextdown(long double __x) { return nextdownl(__x); }
657657
template<typename _Tp> inline
658-
__cmath_enable_if_t<__cmath_is_integral_v<_Tp>, double>
658+
__cmath_enable_if_t<__cmath_is_integral_v<_Tp>, double>
659659
nextdown(_Tp __x) { return nextdown(__x); }
660660

661661
using ::pow;

src/libcxx/include/cstdint

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,45 @@
77
#pragma clang system_header
88

99
namespace std {
10-
using::int8_t;
11-
using::int16_t;
12-
using::int24_t;
13-
using::int32_t;
14-
using::int48_t;
15-
using::int64_t;
16-
17-
using::uint8_t;
18-
using::uint16_t;
19-
using::uint24_t;
20-
using::uint32_t;
21-
using::uint48_t;
22-
using::uint64_t;
23-
24-
using::int_least8_t;
25-
using::int_least16_t;
26-
using::int_least32_t;
27-
using::int_least64_t;
28-
29-
using::uint_least8_t;
30-
using::uint_least16_t;
31-
using::uint_least32_t;
32-
using::uint_least64_t;
33-
34-
using::int_fast8_t;
35-
using::int_fast16_t;
36-
using::int_fast32_t;
37-
using::int_fast64_t;
38-
39-
using::uint_fast8_t;
40-
using::uint_fast16_t;
41-
using::uint_fast32_t;
42-
using::uint_fast64_t;
43-
44-
using::intptr_t;
45-
using::uintptr_t;
46-
47-
using::intmax_t;
48-
using::uintmax_t;
10+
using ::int8_t;
11+
using ::int16_t;
12+
using ::int24_t;
13+
using ::int32_t;
14+
using ::int48_t;
15+
using ::int64_t;
16+
17+
using ::uint8_t;
18+
using ::uint16_t;
19+
using ::uint24_t;
20+
using ::uint32_t;
21+
using ::uint48_t;
22+
using ::uint64_t;
23+
24+
using ::int_least8_t;
25+
using ::int_least16_t;
26+
using ::int_least32_t;
27+
using ::int_least64_t;
28+
29+
using ::uint_least8_t;
30+
using ::uint_least16_t;
31+
using ::uint_least32_t;
32+
using ::uint_least64_t;
33+
34+
using ::int_fast8_t;
35+
using ::int_fast16_t;
36+
using ::int_fast32_t;
37+
using ::int_fast64_t;
38+
39+
using ::uint_fast8_t;
40+
using ::uint_fast16_t;
41+
using ::uint_fast32_t;
42+
using ::uint_fast64_t;
43+
44+
using ::intptr_t;
45+
using ::uintptr_t;
46+
47+
using ::intmax_t;
48+
using ::uintmax_t;
4949
} // namespace std
5050

5151
#endif // _EZCXX_CSTDINT

src/libcxx/include/memory

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
// -*- C++ -*-
2-
#ifndef _EZCXX_MEMORY
3-
#define _EZCXX_MEMORY
4-
5-
#pragma clang system_header
6-
7-
namespace std {
8-
9-
template <class _Tp>
10-
constexpr inline _Tp* addressof(_Tp& __x) noexcept {
11-
return __builtin_addressof(__x);
12-
}
13-
14-
template <class _Tp>
15-
_Tp* addressof(const _Tp&&) noexcept = delete;
16-
17-
} // namespace std
18-
19-
#endif // _EZCXX_MEMORY
1+
// -*- C++ -*-
2+
#ifndef _EZCXX_MEMORY
3+
#define _EZCXX_MEMORY
4+
5+
#pragma clang system_header
6+
7+
namespace std {
8+
9+
template <class _Tp>
10+
constexpr inline _Tp* addressof(_Tp& __x) noexcept {
11+
return __builtin_addressof(__x);
12+
}
13+
14+
template <class _Tp>
15+
_Tp* addressof(const _Tp&&) noexcept = delete;
16+
17+
} // namespace std
18+
19+
#endif // _EZCXX_MEMORY

src/libcxx/include/numbers

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <type_traits>
1414

1515
#if __cplusplus >= 201907L
16-
#include <concepts>
16+
#include <concepts>
1717
#endif
1818

1919
#pragma clang system_header
@@ -31,10 +31,10 @@ inline constexpr bool __false = false;
3131

3232
template <class _Tp>
3333
struct __illformed {
34-
static_assert(
35-
__false<_Tp>,
36-
"A program that instantiates a primary template of a mathematical constant variable template is ill-formed."
37-
);
34+
static_assert(
35+
__false<_Tp>,
36+
"A program that instantiates a primary template of a mathematical constant variable template is ill-formed."
37+
);
3838
};
3939

4040
template <class _Tp>

0 commit comments

Comments
 (0)