Browse Source

some more min/max wrappings

Steven French 1 year ago
parent
commit
8c55406e88
2 changed files with 18 additions and 18 deletions
  1. 10 10
      glm/ext/scalar_common.hpp
  2. 8 8
      glm/ext/scalar_common.inl

+ 10 - 10
glm/ext/scalar_common.hpp

@@ -31,7 +31,7 @@ namespace glm
 	///
 	/// @see ext_scalar_common
 	template<typename T>
-	GLM_FUNC_DECL T min(T a, T b, T c);
+	GLM_FUNC_DECL T (min)(T a, T b, T c);
 
 	/// Returns the minimum component-wise values of 4 inputs
 	///
@@ -39,7 +39,7 @@ namespace glm
 	///
 	/// @see ext_scalar_common
 	template<typename T>
-	GLM_FUNC_DECL T min(T a, T b, T c, T d);
+	GLM_FUNC_DECL T (min)(T a, T b, T c, T d);
 
 	/// Returns the maximum component-wise values of 3 inputs
 	///
@@ -47,7 +47,7 @@ namespace glm
 	///
 	/// @see ext_scalar_common
 	template<typename T>
-	GLM_FUNC_DECL T max(T a, T b, T c);
+	GLM_FUNC_DECL T (max)(T a, T b, T c);
 
 	/// Returns the maximum component-wise values of 4 inputs
 	///
@@ -55,7 +55,7 @@ namespace glm
 	///
 	/// @see ext_scalar_common
 	template<typename T>
-	GLM_FUNC_DECL T max(T a, T b, T c, T d);
+	GLM_FUNC_DECL T (max)(T a, T b, T c, T d);
 
 	/// 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.
 	///
@@ -64,7 +64,7 @@ namespace glm
 	/// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmin">std::fmin documentation</a>
 	/// @see ext_scalar_common
 	template<typename T>
-	GLM_FUNC_DECL T fmin(T a, T b);
+	GLM_FUNC_DECL T (fmin)(T a, T b);
 
 	/// 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.
 	///
@@ -73,7 +73,7 @@ namespace glm
 	/// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmin">std::fmin documentation</a>
 	/// @see ext_scalar_common
 	template<typename T>
-	GLM_FUNC_DECL T fmin(T a, T b, T c);
+	GLM_FUNC_DECL T (fmin)(T a, T b, T c);
 
 	/// 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.
 	///
@@ -82,7 +82,7 @@ namespace glm
 	/// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmin">std::fmin documentation</a>
 	/// @see ext_scalar_common
 	template<typename T>
-	GLM_FUNC_DECL T fmin(T a, T b, T c, T d);
+	GLM_FUNC_DECL T (fmin)(T a, T b, T c, T d);
 
 	/// 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.
 	///
@@ -91,7 +91,7 @@ namespace glm
 	/// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmax">std::fmax documentation</a>
 	/// @see ext_scalar_common
 	template<typename T>
-	GLM_FUNC_DECL T fmax(T a, T b);
+	GLM_FUNC_DECL T (fmax)(T a, T b);
 
 	/// 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.
 	///
@@ -100,7 +100,7 @@ namespace glm
 	/// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmax">std::fmax documentation</a>
 	/// @see ext_scalar_common
 	template<typename T>
-	GLM_FUNC_DECL T fmax(T a, T b, T C);
+	GLM_FUNC_DECL T (fmax)(T a, T b, T C);
 
 	/// 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.
 	///
@@ -109,7 +109,7 @@ namespace glm
 	/// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmax">std::fmax documentation</a>
 	/// @see ext_scalar_common
 	template<typename T>
-	GLM_FUNC_DECL T fmax(T a, T b, T C, T D);
+	GLM_FUNC_DECL T (fmax)(T a, T b, T C, T D);
 
 	/// 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.
 	///

+ 8 - 8
glm/ext/scalar_common.inl

@@ -1,27 +1,27 @@
 namespace glm
 {
 	template<typename T>
-	GLM_FUNC_QUALIFIER T min(T a, T b, T c)
+	GLM_FUNC_QUALIFIER T (min)(T a, T b, T c)
 	{
-		return glm::min(glm::min(a, b), c);
+		return (glm::min)((glm::min)(a, b), c);
 	}
 
 	template<typename T>
-	GLM_FUNC_QUALIFIER T min(T a, T b, T c, T d)
+	GLM_FUNC_QUALIFIER T (min)(T a, T b, T c, T d)
 	{
-		return glm::min(glm::min(a, b), glm::min(c, d));
+		return (glm::min)((glm::min)(a, b), (glm::min)(c, d));
 	}
 
 	template<typename T>
-	GLM_FUNC_QUALIFIER T max(T a, T b, T c)
+	GLM_FUNC_QUALIFIER T (max)(T a, T b, T c)
 	{
-		return glm::max(glm::max(a, b), c);
+		return (glm::max)((glm::max)(a, b), c);
 	}
 
 	template<typename T>
-	GLM_FUNC_QUALIFIER T max(T a, T b, T c, T d)
+	GLM_FUNC_QUALIFIER T (max)(T a, T b, T c, T d)
 	{
-		return glm::max(glm::max(a, b), glm::max(c, d));
+		return (glm::max)((glm::max)(a, b), (glm::max)(c, d));
 	}
 
 #	if GLM_HAS_CXX11_STL