From e051cd06ab823a2ad4df0958fbc4a014aef9917d Mon Sep 17 00:00:00 2001 From: Michael Hoisie Date: Thu, 28 Dec 2023 17:57:47 +0000 Subject: Rename ARRAYSIZE -> ARRAY_SIZE in Hyphenator.h ARRAYSIZE conflicts with a macro in windows.h. When windows.h is included, ARRAYSIZE is defined, so cpp files that include windows.h and Hyphenator.h will throw an error. This change was originally from ag/20521047. Bug: 317994636 Test: m libminikin librobolectric-nativeruntime Change-Id: I3ec35eeab2f13a5496ce272469c1c818a1357c13 --- include/minikin/Hyphenator.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/minikin/Hyphenator.h b/include/minikin/Hyphenator.h index 26c2a19..7562973 100644 --- a/include/minikin/Hyphenator.h +++ b/include/minikin/Hyphenator.h @@ -122,7 +122,7 @@ inline bool isInsertion(EndHyphenEdit hyph) { } template -constexpr size_t ARRAYSIZE(T const (&)[size]) { +constexpr size_t ARRAY_SIZE(T const (&)[size]) { return size; } constexpr uint32_t HYPHEN_STR_ZWJ[] = {CHAR_ZWJ}; @@ -132,7 +132,7 @@ constexpr uint32_t HYPHEN_STR_MAQAF[] = {CHAR_MAQAF}; constexpr uint32_t HYPHEN_STR_UCAS_HYPHEN[] = {CHAR_UCAS_HYPHEN}; constexpr uint32_t HYPHEN_STR_ZWJ_AND_HYPHEN[] = {CHAR_ZWJ, CHAR_HYPHEN}; constexpr std::pair EMPTY_HYPHEN_STR(nullptr, 0); -#define MAKE_HYPHEN_STR(chars) std::make_pair((chars), ARRAYSIZE(chars)) +#define MAKE_HYPHEN_STR(chars) std::make_pair((chars), ARRAY_SIZE(chars)) inline std::pair getHyphenString(StartHyphenEdit hyph) { if (hyph == StartHyphenEdit::INSERT_ZWJ) { -- cgit v1.2.3