summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hoisie <hoisie@google.com>2023-12-28 17:57:47 +0000
committerMichael Hoisie <hoisie@google.com>2023-12-29 06:45:19 +0000
commite051cd06ab823a2ad4df0958fbc4a014aef9917d (patch)
tree047b3aedf6337c0d580a99bf9f9f52ed4886fbba
parent8f1bf2164264f246ffa9bb781088e3554094980b (diff)
downloadminikin-android12-hostruntime-dev.tar.gz
Rename ARRAYSIZE -> ARRAY_SIZE in Hyphenator.handroid12-hostruntime-dev
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
-rw-r--r--include/minikin/Hyphenator.h4
1 files 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 <typename T, size_t size>
-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<const uint32_t*, size_t> 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<const uint32_t*, size_t> getHyphenString(StartHyphenEdit hyph) {
if (hyph == StartHyphenEdit::INSERT_ZWJ) {