Skip to content

Commit 745745c

Browse files
committed
Move undefs next to function definitions
1 parent bbcf24a commit 745745c

20 files changed

+142
-69
lines changed

libcxx/include/__math/abs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ namespace __math {
2323

2424
// fabs
2525

26+
#undef fabs
27+
2628
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI float fabs(float __x) _NOEXCEPT { return __builtin_fabsf(__x); }
2729

2830
template <class = int>

libcxx/include/__math/copysign.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ namespace __math {
2525

2626
// copysign
2727

28+
#undef copysign
29+
2830
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI float copysign(float __x, float __y) _NOEXCEPT {
2931
return ::__builtin_copysignf(__x, __y);
3032
}

libcxx/include/__math/error_functions.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ namespace __math {
2323

2424
// erf
2525

26+
#undef erf
27+
2628
inline _LIBCPP_HIDE_FROM_ABI float erf(float __x) _NOEXCEPT { return __builtin_erff(__x); }
2729

2830
template <class = int>
@@ -39,6 +41,8 @@ inline _LIBCPP_HIDE_FROM_ABI double erf(_A1 __x) _NOEXCEPT {
3941

4042
// erfc
4143

44+
#undef erfc
45+
4246
inline _LIBCPP_HIDE_FROM_ABI float erfc(float __x) _NOEXCEPT { return __builtin_erfcf(__x); }
4347

4448
template <class = int>

libcxx/include/__math/exponential_functions.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ namespace __math {
2626

2727
// exp
2828

29+
#undef exp
30+
2931
inline _LIBCPP_HIDE_FROM_ABI float exp(float __x) _NOEXCEPT { return __builtin_expf(__x); }
3032

3133
template <class = int>
@@ -42,6 +44,8 @@ inline _LIBCPP_HIDE_FROM_ABI double exp(_A1 __x) _NOEXCEPT {
4244

4345
// frexp
4446

47+
#undef frexp
48+
4549
inline _LIBCPP_HIDE_FROM_ABI float frexp(float __x, int* __e) _NOEXCEPT { return __builtin_frexpf(__x, __e); }
4650

4751
template <class = int>
@@ -60,6 +64,8 @@ inline _LIBCPP_HIDE_FROM_ABI double frexp(_A1 __x, int* __e) _NOEXCEPT {
6064

6165
// ldexp
6266

67+
#undef ldexp
68+
6369
inline _LIBCPP_HIDE_FROM_ABI float ldexp(float __x, int __e) _NOEXCEPT { return __builtin_ldexpf(__x, __e); }
6470

6571
template <class = int>
@@ -78,6 +84,8 @@ inline _LIBCPP_HIDE_FROM_ABI double ldexp(_A1 __x, int __e) _NOEXCEPT {
7884

7985
// exp2
8086

87+
#undef exp2
88+
8189
inline _LIBCPP_HIDE_FROM_ABI float exp2(float __x) _NOEXCEPT { return __builtin_exp2f(__x); }
8290

8391
template <class = int>
@@ -94,6 +102,8 @@ inline _LIBCPP_HIDE_FROM_ABI double exp2(_A1 __x) _NOEXCEPT {
94102

95103
// expm1
96104

105+
#undef expm1
106+
97107
inline _LIBCPP_HIDE_FROM_ABI float expm1(float __x) _NOEXCEPT { return __builtin_expm1f(__x); }
98108

99109
template <class = int>
@@ -110,6 +120,8 @@ inline _LIBCPP_HIDE_FROM_ABI double expm1(_A1 __x) _NOEXCEPT {
110120

111121
// scalbln
112122

123+
#undef scalbln
124+
113125
inline _LIBCPP_HIDE_FROM_ABI float scalbln(float __x, long __y) _NOEXCEPT { return __builtin_scalblnf(__x, __y); }
114126

115127
template <class = int>
@@ -128,6 +140,8 @@ inline _LIBCPP_HIDE_FROM_ABI double scalbln(_A1 __x, long __y) _NOEXCEPT {
128140

129141
// scalbn
130142

143+
#undef scalbn
144+
131145
inline _LIBCPP_HIDE_FROM_ABI float scalbn(float __x, int __y) _NOEXCEPT { return __builtin_scalbnf(__x, __y); }
132146

133147
template <class = int>
@@ -146,6 +160,8 @@ inline _LIBCPP_HIDE_FROM_ABI double scalbn(_A1 __x, int __y) _NOEXCEPT {
146160

147161
// pow
148162

163+
#undef pow
164+
149165
inline _LIBCPP_HIDE_FROM_ABI float pow(float __x, float __y) _NOEXCEPT { return __builtin_powf(__x, __y); }
150166

151167
template <class = int>

libcxx/include/__math/fdim.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2323

2424
namespace __math {
2525

26+
// fdim
27+
28+
#undef fdim
29+
2630
inline _LIBCPP_HIDE_FROM_ABI float fdim(float __x, float __y) _NOEXCEPT { return __builtin_fdimf(__x, __y); }
2731

2832
template <class = int>

libcxx/include/__math/fma.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2323

2424
namespace __math {
2525

26+
// fma
27+
28+
#undef fma
29+
2630
inline _LIBCPP_HIDE_FROM_ABI float fma(float __x, float __y, float __z) _NOEXCEPT {
2731
return __builtin_fmaf(__x, __y, __z);
2832
}

libcxx/include/__math/gamma.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ namespace __math {
2323

2424
// lgamma
2525

26+
#undef lgamma
27+
2628
inline _LIBCPP_HIDE_FROM_ABI float lgamma(float __x) _NOEXCEPT { return __builtin_lgammaf(__x); }
2729

2830
template <class = int>
@@ -41,6 +43,8 @@ inline _LIBCPP_HIDE_FROM_ABI double lgamma(_A1 __x) _NOEXCEPT {
4143

4244
// tgamma
4345

46+
#undef tgamma
47+
4448
inline _LIBCPP_HIDE_FROM_ABI float tgamma(float __x) _NOEXCEPT { return __builtin_tgammaf(__x); }
4549

4650
template <class = int>

libcxx/include/__math/hyperbolic_functions.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ namespace __math {
2323

2424
// cosh
2525

26+
#undef cosh
27+
2628
inline _LIBCPP_HIDE_FROM_ABI float cosh(float __x) _NOEXCEPT { return __builtin_coshf(__x); }
2729

2830
template <class = int>
@@ -39,6 +41,8 @@ inline _LIBCPP_HIDE_FROM_ABI double cosh(_A1 __x) _NOEXCEPT {
3941

4042
// sinh
4143

44+
#undef sinh
45+
4246
inline _LIBCPP_HIDE_FROM_ABI float sinh(float __x) _NOEXCEPT { return __builtin_sinhf(__x); }
4347

4448
template <class = int>
@@ -55,6 +59,8 @@ inline _LIBCPP_HIDE_FROM_ABI double sinh(_A1 __x) _NOEXCEPT {
5559

5660
// tanh
5761

62+
#undef tanh
63+
5864
inline _LIBCPP_HIDE_FROM_ABI float tanh(float __x) _NOEXCEPT { return __builtin_tanhf(__x); }
5965

6066
template <class = int>

libcxx/include/__math/hypot.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2323

2424
namespace __math {
2525

26+
// hypot
27+
28+
#undef hypot
29+
2630
inline _LIBCPP_HIDE_FROM_ABI float hypot(float __x, float __y) _NOEXCEPT { return __builtin_hypotf(__x, __y); }
2731

2832
template <class = int>

libcxx/include/__math/inverse_hyperbolic_functions.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ namespace __math {
2323

2424
// acosh
2525

26+
#undef acosh
27+
2628
inline _LIBCPP_HIDE_FROM_ABI float acosh(float __x) _NOEXCEPT { return __builtin_acoshf(__x); }
2729

2830
template <class = int>
@@ -39,6 +41,8 @@ inline _LIBCPP_HIDE_FROM_ABI double acosh(_A1 __x) _NOEXCEPT {
3941

4042
// asinh
4143

44+
#undef asinh
45+
4246
inline _LIBCPP_HIDE_FROM_ABI float asinh(float __x) _NOEXCEPT { return __builtin_asinhf(__x); }
4347

4448
template <class = int>
@@ -55,6 +59,8 @@ inline _LIBCPP_HIDE_FROM_ABI double asinh(_A1 __x) _NOEXCEPT {
5559

5660
// atanh
5761

62+
#undef atanh
63+
5864
inline _LIBCPP_HIDE_FROM_ABI float atanh(float __x) _NOEXCEPT { return __builtin_atanhf(__x); }
5965

6066
template <class = int>

libcxx/include/__math/inverse_trigonometric_functions.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ namespace __math {
2626

2727
// acos
2828

29+
#undef acos
30+
2931
inline _LIBCPP_HIDE_FROM_ABI float acos(float __x) _NOEXCEPT { return __builtin_acosf(__x); }
3032

3133
template <class = int>
@@ -42,6 +44,8 @@ inline _LIBCPP_HIDE_FROM_ABI double acos(_A1 __x) _NOEXCEPT {
4244

4345
// asin
4446

47+
#undef asin
48+
4549
inline _LIBCPP_HIDE_FROM_ABI float asin(float __x) _NOEXCEPT { return __builtin_asinf(__x); }
4650

4751
template <class = int>
@@ -58,6 +62,8 @@ inline _LIBCPP_HIDE_FROM_ABI double asin(_A1 __x) _NOEXCEPT {
5862

5963
// atan
6064

65+
#undef atan
66+
6167
inline _LIBCPP_HIDE_FROM_ABI float atan(float __x) _NOEXCEPT { return __builtin_atanf(__x); }
6268

6369
template <class = int>
@@ -74,6 +80,8 @@ inline _LIBCPP_HIDE_FROM_ABI double atan(_A1 __x) _NOEXCEPT {
7480

7581
// atan2
7682

83+
#undef atan2
84+
7785
inline _LIBCPP_HIDE_FROM_ABI float atan2(float __y, float __x) _NOEXCEPT { return __builtin_atan2f(__y, __x); }
7886

7987
template <class = int>

libcxx/include/__math/logarithms.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ namespace __math {
2323

2424
// log
2525

26+
#undef log
27+
2628
inline _LIBCPP_HIDE_FROM_ABI float log(float __x) _NOEXCEPT { return __builtin_logf(__x); }
2729

2830
template <class = int>
@@ -39,6 +41,8 @@ inline _LIBCPP_HIDE_FROM_ABI double log(_A1 __x) _NOEXCEPT {
3941

4042
// log10
4143

44+
#undef log10
45+
4246
inline _LIBCPP_HIDE_FROM_ABI float log10(float __x) _NOEXCEPT { return __builtin_log10f(__x); }
4347

4448
template <class = int>
@@ -55,6 +59,8 @@ inline _LIBCPP_HIDE_FROM_ABI double log10(_A1 __x) _NOEXCEPT {
5559

5660
// ilogb
5761

62+
#undef ilogb
63+
5864
inline _LIBCPP_HIDE_FROM_ABI int ilogb(float __x) _NOEXCEPT { return __builtin_ilogbf(__x); }
5965

6066
template <class = int>
@@ -71,6 +77,8 @@ inline _LIBCPP_HIDE_FROM_ABI int ilogb(_A1 __x) _NOEXCEPT {
7177

7278
// log1p
7379

80+
#undef log1p
81+
7482
inline _LIBCPP_HIDE_FROM_ABI float log1p(float __x) _NOEXCEPT { return __builtin_log1pf(__x); }
7583

7684
template <class = int>
@@ -87,6 +95,8 @@ inline _LIBCPP_HIDE_FROM_ABI double log1p(_A1 __x) _NOEXCEPT {
8795

8896
// log2
8997

98+
#undef log2
99+
90100
inline _LIBCPP_HIDE_FROM_ABI float log2(float __x) _NOEXCEPT { return __builtin_log2f(__x); }
91101

92102
template <class = int>
@@ -103,6 +113,8 @@ inline _LIBCPP_HIDE_FROM_ABI double log2(_A1 __x) _NOEXCEPT {
103113

104114
// logb
105115

116+
#undef logb
117+
106118
inline _LIBCPP_HIDE_FROM_ABI float logb(float __x) _NOEXCEPT { return __builtin_logbf(__x); }
107119

108120
template <class = int>

libcxx/include/__math/min_max.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ namespace __math {
2525

2626
// fmax
2727

28+
#undef fmax
29+
2830
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI float fmax(float __x, float __y) _NOEXCEPT {
2931
return __builtin_fmaxf(__x, __y);
3032
}
@@ -47,6 +49,8 @@ _LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::typ
4749

4850
// fmin
4951

52+
#undef fmin
53+
5054
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI float fmin(float __x, float __y) _NOEXCEPT {
5155
return __builtin_fminf(__x, __y);
5256
}

libcxx/include/__math/modulo.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ namespace __math {
2525

2626
// fmod
2727

28+
#undef fmod
29+
2830
inline _LIBCPP_HIDE_FROM_ABI float fmod(float __x, float __y) _NOEXCEPT { return __builtin_fmodf(__x, __y); }
2931

3032
template <class = int>
@@ -45,6 +47,8 @@ inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type fmod(_A1 __x, _A
4547

4648
// modf
4749

50+
#undef modf
51+
4852
inline _LIBCPP_HIDE_FROM_ABI float modf(float __x, float* __y) _NOEXCEPT { return __builtin_modff(__x, __y); }
4953

5054
template <class = int>

libcxx/include/__math/remainder.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ namespace __math {
2626

2727
// remainder
2828

29+
#undef remainder
30+
2931
inline _LIBCPP_HIDE_FROM_ABI float remainder(float __x, float __y) _NOEXCEPT { return __builtin_remainderf(__x, __y); }
3032

3133
template <class = int>
@@ -46,6 +48,8 @@ inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type remainder(_A1 __
4648

4749
// remquo
4850

51+
#undef remquo
52+
4953
inline _LIBCPP_HIDE_FROM_ABI float remquo(float __x, float __y, int* __z) _NOEXCEPT {
5054
return __builtin_remquof(__x, __y, __z);
5155
}

libcxx/include/__math/roots.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ namespace __math {
2323

2424
// sqrt
2525

26+
#undef sqrt
27+
2628
inline _LIBCPP_HIDE_FROM_ABI float sqrt(float __x) _NOEXCEPT { return __builtin_sqrtf(__x); }
2729

2830
template <class = int>
@@ -39,6 +41,8 @@ inline _LIBCPP_HIDE_FROM_ABI double sqrt(_A1 __x) _NOEXCEPT {
3941

4042
// cbrt
4143

44+
#undef cbrt
45+
4246
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI float cbrt(float __x) _NOEXCEPT { return __builtin_cbrtf(__x); }
4347

4448
template <class = int>

0 commit comments

Comments
 (0)