chiark / gitweb /
Patch stdlib.h to have MB_CUR_MAX=4
authorFredrik Fornwall <fredrik@fornwall.net>
Tue, 22 Mar 2016 20:58:15 +0000 (16:58 -0400)
committerFredrik Fornwall <fredrik@fornwall.net>
Tue, 22 Mar 2016 20:58:15 +0000 (16:58 -0400)
We always want to use utf-8 so let's try this.

ndk_patches/stdlib.h.patch [new file with mode: 0644]
packages/libandroid-support/stdlib.h.patch [deleted file]

diff --git a/ndk_patches/stdlib.h.patch b/ndk_patches/stdlib.h.patch
new file mode 100644 (file)
index 0000000..c48d874
--- /dev/null
@@ -0,0 +1,14 @@
+diff -u -r /home/fornwall/lib/android-ndk/platforms/android-21/arch-arm64/usr/include/stdlib.h ./usr/include/stdlib.h
+--- /home/fornwall/lib/android-ndk/platforms/android-21/arch-arm64/usr/include/stdlib.h        2016-03-03 16:54:24.000000000 -0500
++++ ./usr/include/stdlib.h     2016-03-22 16:38:58.589340159 -0400
+@@ -161,8 +161,8 @@
+ extern int    wctomb(char *, wchar_t);
+ extern size_t wcstombs(char *, const wchar_t *, size_t);
+-extern size_t __ctype_get_mb_cur_max(void);
+-#define MB_CUR_MAX __ctype_get_mb_cur_max()
++/* Termux modification: Always utf-8. */
++#define MB_CUR_MAX 4
+ __END_DECLS
diff --git a/packages/libandroid-support/stdlib.h.patch b/packages/libandroid-support/stdlib.h.patch
deleted file mode 100644 (file)
index b66371b..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-From MB_CUR_MAX(3): "The MB_CUR_MAX macro defines an integer expression giving the maximum number of
-bytes needed to represent a single wide character in the current locale.  It is locale dependent and
-therefore not a compile-time constant."
-
-Since libandroid-support.so supports multibyte characters we override the platform value of 1.
-
-diff -N -u -r /home/fornwall/lib/android-ndk/sources/android/support/include/stdlib.h ./include/stdlib.h
---- /home/fornwall/lib/android-ndk/sources/android/support/include/stdlib.h    2014-10-15 21:46:32.000000000 -0400
-+++ ./include/stdlib.h 2014-11-27 10:48:54.634215480 -0500
-@@ -36,6 +36,9 @@
- #include <xlocale.h>
-+#undef MB_CUR_MAX
-+#define MB_CUR_MAX 4
-+
- #ifdef __cplusplus
- extern "C" {
- #endif