Skip to content

Commit 903b798

Browse files
Fix GCC 8.1 build.
1 parent 7b95168 commit 903b798

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

build_glslang_spirv_tools.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ cd ../..
2020
echo "Building SPIRV-Tools."
2121
mkdir -p external/spirv-tools-build
2222
cd external/spirv-tools-build
23-
cmake ../spirv-tools -DCMAKE_BUILD_TYPE=$PROFILE -G"Unix Makefiles"
23+
cmake ../spirv-tools -DCMAKE_BUILD_TYPE=$PROFILE -G"Unix Makefiles" -DSPIRV_WERROR=OFF
2424
make -j$NPROC
2525
cd ../..
2626

spirv_common.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,7 @@ struct SPIRConstant : IVariant
867867
// Workaround for MSVC 2013, initializing an array breaks.
868868
ConstantVector()
869869
{
870+
memset(r, 0, sizeof(r));
870871
for (unsigned i = 0; i < 4; i++)
871872
id[i] = 0;
872873
}
@@ -1005,7 +1006,7 @@ struct SPIRConstant : IVariant
10051006

10061007
inline void make_null(const SPIRType &constant_type_)
10071008
{
1008-
std::memset(&m, 0, sizeof(m));
1009+
m = {};
10091010
m.columns = constant_type_.columns;
10101011
for (auto &c : m.c)
10111012
c.vecsize = constant_type_.vecsize;

0 commit comments

Comments
 (0)