Skip to content

Commit 74eb4f7

Browse files
committed
some more min/max wrappings
1 parent 9921bfb commit 74eb4f7

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

glm/ext/scalar_common.hpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -31,31 +31,31 @@ namespace glm
3131
///
3232
/// @see ext_scalar_common
3333
template<typename T>
34-
GLM_FUNC_DECL T min(T a, T b, T c);
34+
GLM_FUNC_DECL T (min)(T a, T b, T c);
3535

3636
/// Returns the minimum component-wise values of 4 inputs
3737
///
3838
/// @tparam T A floating-point scalar type.
3939
///
4040
/// @see ext_scalar_common
4141
template<typename T>
42-
GLM_FUNC_DECL T min(T a, T b, T c, T d);
42+
GLM_FUNC_DECL T (min)(T a, T b, T c, T d);
4343

4444
/// Returns the maximum component-wise values of 3 inputs
4545
///
4646
/// @tparam T A floating-point scalar type.
4747
///
4848
/// @see ext_scalar_common
4949
template<typename T>
50-
GLM_FUNC_DECL T max(T a, T b, T c);
50+
GLM_FUNC_DECL T (max)(T a, T b, T c);
5151

5252
/// Returns the maximum component-wise values of 4 inputs
5353
///
5454
/// @tparam T A floating-point scalar type.
5555
///
5656
/// @see ext_scalar_common
5757
template<typename T>
58-
GLM_FUNC_DECL T max(T a, T b, T c, T d);
58+
GLM_FUNC_DECL T (max)(T a, T b, T c, T d);
5959

6060
/// Returns the minimum component-wise values of 2 inputs. If one of the two arguments is NaN, the value of the other argument is returned.
6161
///
@@ -64,7 +64,7 @@ namespace glm
6464
/// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmin">std::fmin documentation</a>
6565
/// @see ext_scalar_common
6666
template<typename T>
67-
GLM_FUNC_DECL T fmin(T a, T b);
67+
GLM_FUNC_DECL T (fmin)(T a, T b);
6868

6969
/// Returns the minimum component-wise values of 3 inputs. If one of the two arguments is NaN, the value of the other argument is returned.
7070
///
@@ -73,7 +73,7 @@ namespace glm
7373
/// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmin">std::fmin documentation</a>
7474
/// @see ext_scalar_common
7575
template<typename T>
76-
GLM_FUNC_DECL T fmin(T a, T b, T c);
76+
GLM_FUNC_DECL T (fmin)(T a, T b, T c);
7777

7878
/// Returns the minimum component-wise values of 4 inputs. If one of the two arguments is NaN, the value of the other argument is returned.
7979
///
@@ -82,7 +82,7 @@ namespace glm
8282
/// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmin">std::fmin documentation</a>
8383
/// @see ext_scalar_common
8484
template<typename T>
85-
GLM_FUNC_DECL T fmin(T a, T b, T c, T d);
85+
GLM_FUNC_DECL T (fmin)(T a, T b, T c, T d);
8686

8787
/// Returns the maximum component-wise values of 2 inputs. If one of the two arguments is NaN, the value of the other argument is returned.
8888
///
@@ -91,7 +91,7 @@ namespace glm
9191
/// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmax">std::fmax documentation</a>
9292
/// @see ext_scalar_common
9393
template<typename T>
94-
GLM_FUNC_DECL T fmax(T a, T b);
94+
GLM_FUNC_DECL T (fmax)(T a, T b);
9595

9696
/// Returns the maximum component-wise values of 3 inputs. If one of the two arguments is NaN, the value of the other argument is returned.
9797
///
@@ -100,7 +100,7 @@ namespace glm
100100
/// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmax">std::fmax documentation</a>
101101
/// @see ext_scalar_common
102102
template<typename T>
103-
GLM_FUNC_DECL T fmax(T a, T b, T C);
103+
GLM_FUNC_DECL T (fmax)(T a, T b, T C);
104104

105105
/// Returns the maximum component-wise values of 4 inputs. If one of the two arguments is NaN, the value of the other argument is returned.
106106
///
@@ -109,7 +109,7 @@ namespace glm
109109
/// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmax">std::fmax documentation</a>
110110
/// @see ext_scalar_common
111111
template<typename T>
112-
GLM_FUNC_DECL T fmax(T a, T b, T C, T D);
112+
GLM_FUNC_DECL T (fmax)(T a, T b, T C, T D);
113113

114114
/// Returns min(max(x, minVal), maxVal) for each component in x. If one of the two arguments is NaN, the value of the other argument is returned.
115115
///

glm/ext/scalar_common.inl

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
namespace glm
22
{
33
template<typename T>
4-
GLM_FUNC_QUALIFIER T min(T a, T b, T c)
4+
GLM_FUNC_QUALIFIER T (min)(T a, T b, T c)
55
{
6-
return glm::min(glm::min(a, b), c);
6+
return (glm::min)((glm::min)(a, b), c);
77
}
88

99
template<typename T>
10-
GLM_FUNC_QUALIFIER T min(T a, T b, T c, T d)
10+
GLM_FUNC_QUALIFIER T (min)(T a, T b, T c, T d)
1111
{
12-
return glm::min(glm::min(a, b), glm::min(c, d));
12+
return (glm::min)((glm::min)(a, b), (glm::min)(c, d));
1313
}
1414

1515
template<typename T>
16-
GLM_FUNC_QUALIFIER T max(T a, T b, T c)
16+
GLM_FUNC_QUALIFIER T (max)(T a, T b, T c)
1717
{
18-
return glm::max(glm::max(a, b), c);
18+
return (glm::max)((glm::max)(a, b), c);
1919
}
2020

2121
template<typename T>
22-
GLM_FUNC_QUALIFIER T max(T a, T b, T c, T d)
22+
GLM_FUNC_QUALIFIER T (max)(T a, T b, T c, T d)
2323
{
24-
return glm::max(glm::max(a, b), glm::max(c, d));
24+
return (glm::max)((glm::max)(a, b), (glm::max)(c, d));
2525
}
2626

2727
# if GLM_HAS_CXX11_STL

0 commit comments

Comments
 (0)