Mesa (staging/21.2): aco: Work around MSVC restrict in c99_compat.h

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Nov 24 22:54:05 UTC 2021


Module: Mesa
Branch: staging/21.2
Commit: b0b00b3178b5c60f3a1c2f205c8749ecabd49dba
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b0b00b3178b5c60f3a1c2f205c8749ecabd49dba

Author: pal1000 <liviuprodea at yahoo.com>
Date:   Tue Nov 16 11:04:51 2021 +0200

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 at basnieuwenhuizen.nl>
(cherry picked from commit e0de7aa4d7717bbd79bbc5bfc660f941f680402b)

# Conflicts:
#	src/amd/compiler/aco_print_asm.cpp

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13813>

---

 src/amd/compiler/aco_print_asm.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/amd/compiler/aco_print_asm.cpp b/src/amd/compiler/aco_print_asm.cpp
index dcc7c4bc747..413e6464c79 100644
--- a/src/amd/compiler/aco_print_asm.cpp
+++ b/src/amd/compiler/aco_print_asm.cpp
@@ -24,6 +24,9 @@
 
 #include "aco_ir.h"
 
+#if defined(_MSC_VER) && defined(restrict)
+#undef restrict
+#endif
 #include "llvm/ac_llvm_util.h"
 
 #include "llvm-c/Disassembler.h"



More information about the mesa-commit mailing list