summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorGert Wollny <[email protected]>2017-09-06 14:21:25 +0200
committerNicolai Hähnle <[email protected]>2017-09-06 15:12:19 +0200
commit107ecd97f1b978599daf689db68a40c5f9dcd025 (patch)
treead2a6b1d505225e12e98a0ac7e8550e167cead26 /src/mesa/state_tracker
parent09ffe274b050c3433996c0ee2f773e9d107a3fa6 (diff)
mesa/st/st_glsl_to_tgsi_temprename.cpp: Fix compilation with MSVC
If <windows.h> is included then max is a macro that clashes with std::numeric_limits::max, hence undefine it. For some reason the struct access_record is not recognizes outside the anonymouse namespace, make it a class. The patch successfully was tested on AppVeyor. Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_glsl_to_tgsi_temprename.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi_temprename.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi_temprename.cpp
index d984184e701..00ec7e749bd 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi_temprename.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi_temprename.cpp
@@ -43,6 +43,13 @@ using std::cerr;
using std::setw;
#endif
+/* If <windows.h> is included this is defined and clashes with
+ * std::numeric_limits<>::max()
+ */
+#ifdef max
+#undef max
+#endif
+
using std::numeric_limits;
/* Without c++11 define the nullptr for forward-compatibility
@@ -592,7 +599,8 @@ lifetime temp_comp_access::get_required_lifetime()
/* Helper class for sorting and searching the registers based
* on life times. */
-struct access_record {
+class access_record {
+public:
int begin;
int end;
int reg;