summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Park <jpark37@lagfreegames.com>2021-10-23 18:02:48 -0700
committerEric Engestrom <eric@engestrom.ch>2021-11-17 20:06:21 +0000
commit9586feff54d024518d7cc83712f741cbc559a251 (patch)
tree6e402a1210a26332d8bfefcf003d2314615680fe
parentffb3ab4d7ad5a0f38cf308fc81c69c460e1bf6a6 (diff)
aco: Work around MSVC restrict in c99_compat.h
Future LLVM header leads to __declspec(__restrict), which is invalid. Just undefine the restrict macro to keep __declspec(restrict). Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13505> (cherry picked from commit e0de7aa4d7717bbd79bbc5bfc660f941f680402b)
-rw-r--r--.pick_status.json2
-rw-r--r--src/amd/compiler/aco_print_asm.cpp3
2 files changed, 4 insertions, 1 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 666a3b17de9..531e72e2900 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1894,7 +1894,7 @@
"description": "aco: Work around MSVC restrict in c99_compat.h",
"nominated": false,
"nomination_type": null,
- "resolution": 4,
+ "resolution": 1,
"main_sha": null,
"because_sha": null
},
diff --git a/src/amd/compiler/aco_print_asm.cpp b/src/amd/compiler/aco_print_asm.cpp
index 9f15de5aacd..cbd29e13212 100644
--- a/src/amd/compiler/aco_print_asm.cpp
+++ b/src/amd/compiler/aco_print_asm.cpp
@@ -25,6 +25,9 @@
#include "aco_ir.h"
#ifdef LLVM_AVAILABLE
+#if defined(_MSC_VER) && defined(restrict)
+#undef restrict
+#endif
#include "llvm/ac_llvm_util.h"
#include "llvm-c/Disassembler.h"