When multibyte support is disabled, locale_utf8locale and UTF8_SINGLEBYTE are 
not available. This causes a compilation error in lib/glob/smatch.c in 
functions like is_cclass, collseqcmp, and the FOLD macro.

This fixes the following failure seen with br-arm-basic toolchain:

strmatch.c:145:7: error: 'locale_utf8locale' undeclared (first use in this 
function)

  145 |   if (locale_utf8locale && (UTF8_SINGLEBYTE (c) == 0 || UTF8_SINGLEBYTE 
(equiv) == 0))

Fix this by adding an extern declaration for locale_utf8locale for 
non-multibyte builds in shmbutil.h.

Signed-off-by: Shubham Chakraborty <[email protected]>
---
 include/shmbutil.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/shmbutil.h b/include/shmbutil.h
index 1feee853..a18d08b7 100644
--- a/include/shmbutil.h
+++ b/include/shmbutil.h
@@ -88,6 +88,8 @@ extern int locale_utf8locale; /* XXX */
 
 #define VALID_SINGLEBYTE_CHAR(c)  (1)
 
+extern int locale_utf8locale;
+
 #endif /* !HANDLE_MULTIBYTE */
 
 /* Declare and initialize a multibyte state.  Call must be terminated
-- 
2.55.0


Reply via email to