From: Jason Ekstrand Date: Fri, 10 Jul 2015 17:59:09 +0000 (-0700) Subject: nir: Add C++ versions of NIR_(SRC|DEST)_INIT X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=18340883e3c9736db5ed319dfb036af00c39ba82;p=mesa.git nir: Add C++ versions of NIR_(SRC|DEST)_INIT --- diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h index c666d93e66b..7a088c44e8b 100644 --- a/src/glsl/nir/nir.h +++ b/src/glsl/nir/nir.h @@ -511,7 +511,11 @@ typedef struct nir_src { bool is_ssa; } nir_src; -#define NIR_SRC_INIT (nir_src) { { NULL } } +#ifdef __cplusplus +# define NIR_SRC_INIT nir_src() +#else +# define NIR_SRC_INIT (nir_src) { { NULL } } +#endif #define nir_foreach_use(reg_or_ssa_def, src) \ list_for_each_entry(nir_src, src, &(reg_or_ssa_def)->uses, use_link) @@ -534,7 +538,11 @@ typedef struct { bool is_ssa; } nir_dest; -#define NIR_DEST_INIT (nir_dest) { { { NULL } } } +#ifdef __cplusplus +# define NIR_DEST_INIT nir_dest() +#else +# define NIR_DEST_INIT (nir_dest) { { { NULL } } } +#endif #define nir_foreach_def(reg, dest) \ list_for_each_entry(nir_dest, dest, &(reg)->defs, reg.def_link)