From e599a5de39f1e5185bc038f5789938c72d9ef1b6 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 21 Mar 2025 16:30:18 -0400 Subject: [PATCH] Add version check for uc_is_property_prepended_concatenation_mark(), which was instroduced in libunistring v1.2 --- stdlib/text.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/stdlib/text.c b/stdlib/text.c index 966f6ac..bfaa058 100644 --- a/stdlib/text.c +++ b/stdlib/text.c @@ -61,11 +61,12 @@ #include #include -#include #include #include #include #include +#include +#include #include #include "arrays.h" @@ -206,8 +207,12 @@ public int32_t get_synthetic_grapheme(const ucs4_t *codepoints, int64_t utf32_le // that begin with *prefix* modifiers, so we gotta check for that case: synthetic_graphemes[-grapheme_id-1].main_codepoint = length_prefixed[1]; for (ucs4_t i = 0; i < utf32_len; i++) { +#if _LIBUNISTRING_VERSION >= 0x010200 +// libuinstring version 1.2.0 introduced uc_is_property_prepended_concatenation_mark() +// It's not critical, but it's technically more correct to have this check: if (unlikely(uc_is_property_prepended_concatenation_mark(length_prefixed[1+i]))) continue; +#endif synthetic_graphemes[-grapheme_id-1].main_codepoint = length_prefixed[1+i]; break; }