summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-cpp/eigen/files/eigen-9999-please_protect_your_min_with_parentheses.patch')
-rw-r--r--dev-cpp/eigen/files/eigen-9999-please_protect_your_min_with_parentheses.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/dev-cpp/eigen/files/eigen-9999-please_protect_your_min_with_parentheses.patch b/dev-cpp/eigen/files/eigen-9999-please_protect_your_min_with_parentheses.patch
new file mode 100644
index 000000000000..0453fd33a8ae
--- /dev/null
+++ b/dev-cpp/eigen/files/eigen-9999-please_protect_your_min_with_parentheses.patch
@@ -0,0 +1,54 @@
+diff --git a/test/main.h b/test/main.h
+index 771725f06..df22e12f6 100644
+--- a/test/main.h
++++ b/test/main.h
+@@ -86,32 +86,6 @@
+ #define EIGEN_DEFAULT_DENSE_INDEX_TYPE int
+ #endif
+
+-// To test that all calls from Eigen code to std::min() and std::max() are
+-// protected by parenthesis against macro expansion, the min()/max() macros
+-// are defined here and any not-parenthesized min/max call will cause a
+-// compiler error.
+-#if !defined(__HIPCC__) && !defined(EIGEN_USE_SYCL) && !defined(EIGEN_POCKETFFT_DEFAULT)
+-//
+-// HIP header files include the following files
+-// <thread>
+-// <regex>
+-// <unordered_map>
+-// which seem to contain not-parenthesized calls to "max"/"min", triggering the following check and causing the compile
+-// to fail
+-//
+-// Including those header files before the following macro definition for "min" / "max", only partially resolves the
+-// issue This is because other HIP header files also define "isnan" / "isinf" / "isfinite" functions, which are needed
+-// in other headers.
+-//
+-// So instead choosing to simply disable this check for HIP
+-//
+-#define min(A, B) please_protect_your_min_with_parentheses
+-#define max(A, B) please_protect_your_max_with_parentheses
+-#define isnan(X) please_protect_your_isnan_with_parentheses
+-#define isinf(X) please_protect_your_isinf_with_parentheses
+-#define isfinite(X) please_protect_your_isfinite_with_parentheses
+-#endif
+-
+ // test possible conflicts
+ struct real {};
+ struct imag {};
+diff --git a/test/main.h b/test/main.h
+index df22e12f6..5ca40424e 100644
+--- a/test/main.h
++++ b/test/main.h
+@@ -95,12 +95,6 @@ struct imag {};
+ #endif
+ #define M_PI please_use_EIGEN_PI_instead_of_M_PI
+
+-#define FORBIDDEN_IDENTIFIER \
+- (this_identifier_is_forbidden_to_avoid_clashes) this_identifier_is_forbidden_to_avoid_clashes
+-// B0 is defined in POSIX header termios.h
+-#define B0 FORBIDDEN_IDENTIFIER
+-#define I FORBIDDEN_IDENTIFIER
+-
+ // _res is defined by resolv.h
+ #define _res FORBIDDEN_IDENTIFIER
+