--- file_not_specified_in_diff +++ file_not_specified_in_diff @@ -, +, @@ return N; return N; size_t x = arraysize(non_empty_array); size_t x = arraysize(empty_array); size_t x = size(non_empty_array); size_t x = size(empty_array); size_t x = ARRAY_LENGTH(non_empty_array); size_t x = ARRAY_LENGTH(empty_array); #define arraysize(array) (sizeof(ArraySizeHelper(array))) ^ size_t x = arraysize(empty_array); ^~~~~~~~~ template char (&ArraySizeHelper(T (&array)[N]))[N]; ^~~~~~~~~~~~~~~ size_t x = arraysize(empty_array); ^~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~ ^ ~ size_t x = size(empty_array); ^ constexpr size_t size(const T (&array)[N]) noexcept { ^~~~ size_t x = size(empty_array); ^~~~ ^ ~ --- /third_party/blink/renderer/platform/text/character.cc +++ /third_party/blink/renderer/platform/text/character.cc @@ -61,9 +61,13 @@ return unicodeSet; } -#define CREATE_UNICODE_SET(name) \ - createUnicodeSet(name##Array, arraysize(name##Array), name##Ranges, \ - arraysize(name##Ranges)) +// arraysize (from base/macros.h) and base::size (from base/stl_util.h) +// cause compilation errors with zero-length arrays. +#define ARRAY_LENGTH(a) (sizeof(a) / sizeof((a)[0])) + +#define CREATE_UNICODE_SET(name) \ + createUnicodeSet(name##Array, ARRAY_LENGTH(name##Array), \ + name##Ranges, ARRAY_LENGTH(name##Ranges)) #define RETURN_HAS_PROPERTY(c, name) \ static icu::UnicodeSet* unicodeSet = nullptr; \ --- /third_party/blink/renderer/platform/text/character_property_data_generator.cc +++ /third_party/blink/renderer/platform/text/character_property_data_generator.cc @@ -21,6 +21,8 @@ #else const UChar32 kMaxCodepoint = 0x10FFFF; +// arraysize (from base/macros.h) and base::size (from base/stl_util.h) +// cause compilation errors with zero-length arrays. #define ARRAY_LENGTH(a) (sizeof(a) / sizeof((a)[0])) static void SetRanges(CharacterProperty* values,