From f503d40b847d032937ba381222580324d201fe5b Mon Sep 17 00:00:00 2001 From: "andrewhayden@google.com" Date: Wed, 12 Mar 2014 11:54:05 +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@155 b252ecd4-b096-bf77-eb8e-91563289f87e --- internal/cld2_generated_deltaocta0122.cc | 7 ++++++- internal/cld2_generated_deltaoctachrome0122.cc | 7 ++++++- internal/cld2_generated_distinctocta0122.cc | 7 ++++++- internal/cld2_generated_distinctoctachrome0122.cc | 7 ++++++- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/internal/cld2_generated_deltaocta0122.cc b/internal/cld2_generated_deltaocta0122.cc index f9f137b..e890c34 100644 --- a/internal/cld2_generated_deltaocta0122.cc +++ b/internal/cld2_generated_deltaocta0122.cc @@ -66536,8 +66536,13 @@ extern const CLD2TableSummary kDeltaOcta_obj = { static const uint32 kDeltaOcta0122_2Size = 0; // Bucket count static const uint32 kDeltaOcta0122_2KeyMask = 0xffffffff; // Mask hash key -static const IndirectProbBucket4 kDeltaOcta0122_2[kDeltaOcta0122_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 kDeltaOcta0122_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_deltaoctachrome0122.cc b/internal/cld2_generated_deltaoctachrome0122.cc index c1c19cd..24d8725 100644 --- a/internal/cld2_generated_deltaoctachrome0122.cc +++ b/internal/cld2_generated_deltaoctachrome0122.cc @@ -4574,8 +4574,13 @@ extern const CLD2TableSummary kDeltaOcta_obj = { static const uint32 kDeltaOctaChrome0122_2Size = 0; // Bucket count static const uint32 kDeltaOctaChrome0122_2KeyMask = 0xffffffff; // Mask hash key -static const IndirectProbBucket4 kDeltaOctaChrome0122_2[kDeltaOctaChrome0122_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 kDeltaOctaChrome0122_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_distinctocta0122.cc b/internal/cld2_generated_distinctocta0122.cc index 1f3627c..37d0e78 100644 --- a/internal/cld2_generated_distinctocta0122.cc +++ b/internal/cld2_generated_distinctocta0122.cc @@ -8338,8 +8338,13 @@ extern const CLD2TableSummary kDistinctOcta_obj = { static const uint32 kDistinctOcta0122_2Size = 0; // Bucket count static const uint32 kDistinctOcta0122_2KeyMask = 0xffffffff; // Mask hash key -static const IndirectProbBucket4 kDistinctOcta0122_2[kDistinctOcta0122_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 kDistinctOcta0122_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_distinctoctachrome0122.cc b/internal/cld2_generated_distinctoctachrome0122.cc index 7485bfb..490de65 100644 --- a/internal/cld2_generated_distinctoctachrome0122.cc +++ b/internal/cld2_generated_distinctoctachrome0122.cc @@ -2181,8 +2181,13 @@ extern const CLD2TableSummary kDistinctOcta_obj = { static const uint32 kDistinctOctaChrome0122_2Size = 0; // Bucket count static const uint32 kDistinctOctaChrome0122_2KeyMask = 0xffffffff; // Mask hash key -static const IndirectProbBucket4 kDistinctOctaChrome0122_2[kDistinctOctaChrome0122_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 kDistinctOctaChrome0122_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%)