summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-07-10 10:59:09 -0700
committerJason Ekstrand <[email protected]>2015-07-10 11:57:33 -0700
commit18340883e3c9736db5ed319dfb036af00c39ba82 (patch)
treeb3c94df96f0f3a15c393afa9686083d204a9b972 /src
parent9e64a2a8e4821dd637daac54ba83895a490d4790 (diff)
nir: Add C++ versions of NIR_(SRC|DEST)_INIT
Diffstat (limited to 'src')
-rw-r--r--src/glsl/nir/nir.h12
1 files changed, 10 insertions, 2 deletions
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)