Mesa (master): nir: fix intrinsic builders on MSVC C++

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Nov 27 11:19:48 UTC 2020


Module: Mesa
Branch: master
Commit: 7a77008283757d7c548572ef7a66d8d8c6052134
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7a77008283757d7c548572ef7a66d8d8c6052134

Author: Rhys Perry <pendingchaos02 at gmail.com>
Date:   Fri Nov 27 09:55:11 2020 +0000

nir: fix intrinsic builders on MSVC C++

Fix this error:
error C4576: a parenthesized type followed by an initializer list is a non-standard explicit type conversion syntax

Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Fixes: c9bcad25737 ("nir: add generated intrinsic builders")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7808>

---

 src/compiler/nir/nir_builder_opcodes_h.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/compiler/nir/nir_builder_opcodes_h.py b/src/compiler/nir/nir_builder_opcodes_h.py
index c873054964a..006ed42c407 100644
--- a/src/compiler/nir/nir_builder_opcodes_h.py
+++ b/src/compiler/nir/nir_builder_opcodes_h.py
@@ -138,8 +138,13 @@ _nir_build_${name}(nir_builder *build${intrinsic_decl_list(opcode)})
 
 % for name, opcode in sorted(INTR_OPCODES.items()):
 % if opcode.indices:
+#ifdef __cplusplus
+#define nir_build_${name}(build${intrinsic_macro_list(opcode)}, ...) ${'\\\\'}
+_nir_build_${name}(build${intrinsic_macro_list(opcode)}, _nir_${name}_indices{0, __VA_ARGS__})
+#else
 #define nir_build_${name}(build${intrinsic_macro_list(opcode)}, ...) ${'\\\\'}
 _nir_build_${name}(build${intrinsic_macro_list(opcode)}, (struct _nir_${name}_indices){0, __VA_ARGS__})
+#endif
 % else:
 #define nir_build_${name} _nir_build_${name}
 % endif



More information about the mesa-commit mailing list