From 7a77008283757d7c548572ef7a66d8d8c6052134 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Fri, 27 Nov 2020 09:55:11 +0000 Subject: [PATCH] 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 Reviewed-by: Erik Faye-Lund Fixes: c9bcad25737 ("nir: add generated intrinsic builders") Part-of: --- 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