[PATCH] newlib/libc/ctype: Bypass _jp2uc/_uc2jp if _MB_CAPABLE is not set
andrew@andrewoates.com
andrew@andrewoates.com
Mon Jan 19 17:03:20 GMT 2026
From: Andrew Oates <andrew@andrewoates.com>
Currently, if an application uses towctrans or towctrans_l with a newlib
compiled without _MB_CAPABLE, it will fail to link due to _jp2uc/_uc2jp
being undefined. This extends the cygwin behavior to all
non-_MB_CAPABLE builds.
---
newlib/libc/ctype/local.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/newlib/libc/ctype/local.h b/newlib/libc/ctype/local.h
index 5c293c83d..1acdfd277 100644
--- a/newlib/libc/ctype/local.h
+++ b/newlib/libc/ctype/local.h
@@ -32,7 +32,7 @@
* for towupper and towlower, the result must be back-transformed
into the respective locale encoding; currently NOT IMPLEMENTED
*/
-#ifdef __CYGWIN__
+#if defined(__CYGWIN__) || !defined(_MB_CAPABLE)
/* Under Cygwin, wchar_t (or its extension wint_t) is Unicode */
#define _jp2uc(c) (c)
#define _jp2uc_l(c, l) (c)
--
2.52.0
More information about the Newlib
mailing list