diff options
author | Jose Fonseca <[email protected]> | 2016-04-28 12:17:42 +0100 |
---|---|---|
committer | Jose Fonseca <[email protected]> | 2016-04-28 16:48:12 +0100 |
commit | f7854d8227f0215edae74a7269f6cb1b52049f94 (patch) | |
tree | d25185986b58a92e6f2b7dbb443dd48566a969d2 | |
parent | a609da60c034ab059ead213e6c25fe4d37bf7d43 (diff) |
nir: Avoid C99 field initializers.
As they are not standard C++ and are not supported by MSVC C++ compiler.
Just have nir_imm_double match nir_imm_float above.
Reviewed-by: Connor Abbott <[email protected]>
Reviewed-by: Sinclair Yeh <[email protected]>
-rw-r--r-- | src/compiler/nir/nir_builder.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h index a14f9ef70d3..4fa97799d31 100644 --- a/src/compiler/nir/nir_builder.h +++ b/src/compiler/nir/nir_builder.h @@ -117,9 +117,12 @@ nir_imm_float(nir_builder *build, float x) static inline nir_ssa_def * nir_imm_double(nir_builder *build, double x) { - nir_const_value v = { { .f64 = {x, 0, 0, 0} } }; - nir_ssa_def *def = nir_build_imm(build, 1, 64, v); - return def; + nir_const_value v; + + memset(&v, 0, sizeof(v)); + v.f64[0] = x; + + return nir_build_imm(build, 1, 64, v); } static inline nir_ssa_def * |