aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalin Juravle <calin@google.com>2014-04-29 15:48:34 +0100
committerCalin Juravle <calin@google.com>2014-04-29 20:28:29 +0100
commiteab395e4a88ee8ca7eeb7b6b2d6dfde364afbfcc (patch)
tree2f779ab3756376449aa231e57b556412a8662f5c
parent3ac3f3fd0cab7b4ace8e15fd90ea869b26449df5 (diff)
downloadandroid_bionic-eab395e4a88ee8ca7eeb7b6b2d6dfde364afbfcc.tar.gz
android_bionic-eab395e4a88ee8ca7eeb7b6b2d6dfde364afbfcc.tar.bz2
android_bionic-eab395e4a88ee8ca7eeb7b6b2d6dfde364afbfcc.zip
Reserve space in mbstate to allow for proper wchar support
Bug: 14382788 Change-Id: If023ac9bb65f95135cae7ebe89147e3985a69a96
-rw-r--r--libc/include/limits.h2
-rw-r--r--libc/include/wchar.h11
2 files changed, 10 insertions, 3 deletions
diff --git a/libc/include/limits.h b/libc/include/limits.h
index a70021a07..dc4590299 100644
--- a/libc/include/limits.h
+++ b/libc/include/limits.h
@@ -112,7 +112,7 @@
#define SSIZE_MAX LONG_MAX
-#define MB_LEN_MAX 1 /* No multibyte characters. */
+#define MB_LEN_MAX 6
/* New code should use sysconf(_SC_PAGE_SIZE) instead. */
#ifndef PAGE_SIZE
diff --git a/libc/include/wchar.h b/libc/include/wchar.h
index 0029a65be..6251868da 100644
--- a/libc/include/wchar.h
+++ b/libc/include/wchar.h
@@ -39,8 +39,15 @@
__BEGIN_DECLS
-typedef __WINT_TYPE__ wint_t;
-typedef struct { int dummy; } mbstate_t;
+typedef __WINT_TYPE__ wint_t;
+typedef struct {
+#ifdef __LP32__
+ int dummy;
+#else
+ // 8 bytes should be enough to support at least UTF-8
+ char __reserved[8];
+#endif
+} mbstate_t;
typedef enum {
WC_TYPE_INVALID = 0,