From e48a51799a337e16dc5c1122e7051f99114b4ce5 Mon Sep 17 00:00:00 2001 From: "andrewhayden@google.com" Date: Fri, 14 Mar 2014 08:55:18 +0000 Subject: [PATCH] Fixup for Chromium compile chain on Windows that can't handle zero-length arrays For more information: https://code.google.com/p/cld2/issues/detail?id=9 git-svn-id: https://cld2.googlecode.com/svn/trunk@156 b252ecd4-b096-bf77-eb8e-91563289f87e --- internal/cld2_generated_quad0122.cc | 7 ++++++- internal/cld2_generated_quadchrome0122_2.cc | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/internal/cld2_generated_quad0122.cc b/internal/cld2_generated_quad0122.cc index b599c87..4ce76da 100644 --- a/internal/cld2_generated_quad0122.cc +++ b/internal/cld2_generated_quad0122.cc @@ -307327,8 +307327,13 @@ extern const CLD2TableSummary kQuad_obj = { static const uint32 kQuad0122_2Size = 0; // Bucket count static const uint32 kQuad0122_2KeyMask = 0xffffffff; // Mask hash key -static const IndirectProbBucket4 kQuad0122_2[kQuad0122_2Size] = { +// NOTE: Some compilers will not allow an array of structs to have a constant +// size of zero. Thus, we tell the code that the size is zero, but +// actually allocate a single element array that will never be read. +// More info: https://code.google.com/p/cld2/issues/detail?id=9 +static const IndirectProbBucket4 kQuad0122_2[1] = { // hash_indirect[4], tokens[4] in UTF-8 + {0x00000000,0x00000000,0x00000000,0x00000000} // UNUSED, see above! }; // table_hash = ffff-ffff, unused_entries = 0 (0.00%) diff --git a/internal/cld2_generated_quadchrome0122_2.cc b/internal/cld2_generated_quadchrome0122_2.cc index b382214..95c8e2d 100644 --- a/internal/cld2_generated_quadchrome0122_2.cc +++ b/internal/cld2_generated_quadchrome0122_2.cc @@ -81666,8 +81666,13 @@ extern const CLD2TableSummary kQuad_obj = { static const uint32 kQuadChrome0122_2_2Size = 0; // Bucket count static const uint32 kQuadChrome0122_2_2KeyMask = 0xffffffff; // Mask hash key -static const IndirectProbBucket4 kQuadChrome0122_2_2[kQuadChrome0122_2_2Size] = { +// NOTE: Some compilers will not allow an array of structs to have a constant +// size of zero. Thus, we tell the code that the size is zero, but +// actually allocate a single element array that will never be read. +// More info: https://code.google.com/p/cld2/issues/detail?id=9 +static const IndirectProbBucket4 kQuadChrome0122_2_2[1] = { // hash_indirect[4], tokens[4] in UTF-8 + {0x00000000,0x00000000,0x00000000,0x00000000} // UNUSED, see above! }; // table_hash = ffff-ffff, unused_entries = 0 (0.00%)