diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/unicode.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/include/unicode.h b/include/unicode.h index e0061478d..9f27657df 100644 --- a/include/unicode.h +++ b/include/unicode.h | |||
@@ -5,10 +5,17 @@ | |||
5 | #ifndef UNICODE_H | 5 | #ifndef UNICODE_H |
6 | #define UNICODE_H 1 | 6 | #define UNICODE_H 1 |
7 | 7 | ||
8 | enum { | ||
9 | UNICODE_UNKNOWN = 0, | ||
10 | UNICODE_OFF = 1, | ||
11 | UNICODE_ON = 2, | ||
12 | }; | ||
13 | |||
8 | #if !ENABLE_FEATURE_ASSUME_UNICODE | 14 | #if !ENABLE_FEATURE_ASSUME_UNICODE |
9 | 15 | ||
10 | # define bb_mbstrlen(string) strlen(string) | 16 | # define bb_mbstrlen(string) strlen(string) |
11 | # define check_unicode_in_env() ((void)0) | 17 | # define unicode_status UNICODE_OFF |
18 | # define init_unicode() ((void)0) | ||
12 | 19 | ||
13 | #else | 20 | #else |
14 | 21 | ||
@@ -18,16 +25,19 @@ size_t bb_mbstrlen(const char *string) FAST_FUNC; | |||
18 | 25 | ||
19 | # include <wchar.h> | 26 | # include <wchar.h> |
20 | # include <wctype.h> | 27 | # include <wctype.h> |
21 | # define check_unicode_in_env() ((void)0) | 28 | extern uint8_t unicode_status; |
29 | void init_unicode(void) FAST_FUNC; | ||
22 | 30 | ||
23 | # else | 31 | # else |
24 | 32 | ||
25 | /* Crude "locale support" which knows only C and Unicode locales */ | 33 | /* Crude "locale support" which knows only C and Unicode locales */ |
26 | 34 | ||
27 | # if !ENABLE_FEATURE_CHECK_UNICODE_IN_ENV | 35 | # if !ENABLE_FEATURE_CHECK_UNICODE_IN_ENV |
28 | # define check_unicode_in_env() ((void)0) | 36 | # define unicode_status UNICODE_ON |
37 | # define init_unicode() ((void)0) | ||
29 | # else | 38 | # else |
30 | void check_unicode_in_env(void) FAST_FUNC; | 39 | extern uint8_t unicode_status; |
40 | void init_unicode(void) FAST_FUNC; | ||
31 | # endif | 41 | # endif |
32 | 42 | ||
33 | # undef MB_CUR_MAX | 43 | # undef MB_CUR_MAX |