aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2023-07-23 12:20:42 +0000
committerGitHub <noreply@github.com>2023-07-23 12:20:42 +0000
commita5b78ff089a28651282d765349ede783b1a80fa9 (patch)
tree2cd4cc741e2ee38c5100a6ddea63451ccc278182 /include
parent72b97c86c6c1a1902d6dcda3da7c38db13585cdc (diff)
parent878b3cd27fe83f2b0ff476b884c34d165be0072c (diff)
downloadbusybox-w32-a5b78ff089a28651282d765349ede783b1a80fa9.tar.gz
busybox-w32-a5b78ff089a28651282d765349ede783b1a80fa9.tar.bz2
busybox-w32-a5b78ff089a28651282d765349ede783b1a80fa9.zip
Merge pull request #340 from avih/win32-unicode-editing
Win32: support unicode editing
Diffstat (limited to 'include')
-rw-r--r--include/mingw.h12
-rw-r--r--include/unicode.h15
2 files changed, 27 insertions, 0 deletions
diff --git a/include/mingw.h b/include/mingw.h
index 232ffadd7..97db2f6a9 100644
--- a/include/mingw.h
+++ b/include/mingw.h
@@ -586,6 +586,18 @@ char *alloc_ext_space(const char *path);
586int add_win32_extension(char *p); 586int add_win32_extension(char *p);
587char *file_is_win32_exe(const char *name); 587char *file_is_win32_exe(const char *name);
588 588
589#if ENABLE_UNICODE_SUPPORT
590/*
591 * windows wchar_t is 16 bit, while linux (and busybox expectation) is 32.
592 * so when (busybox) unicode.h is included, wchar_t is 32 bit.
593 * Without unicode.h, MINGW_BB_WCHAR_T is busybox wide char (32),
594 * and wchar_t is Windows wide char (16).
595 */
596#define MINGW_BB_WCHAR_T uint32_t /* keep in sync with unicode.h */
597
598MINGW_BB_WCHAR_T *bs_to_slash_u(MINGW_BB_WCHAR_T *p) FAST_FUNC;
599#endif
600
589char *bs_to_slash(char *p) FAST_FUNC; 601char *bs_to_slash(char *p) FAST_FUNC;
590void slash_to_bs(char *p) FAST_FUNC; 602void slash_to_bs(char *p) FAST_FUNC;
591size_t remove_cr(char *p, size_t len) FAST_FUNC; 603size_t remove_cr(char *p, size_t len) FAST_FUNC;
diff --git a/include/unicode.h b/include/unicode.h
index 0317a2151..e894f7148 100644
--- a/include/unicode.h
+++ b/include/unicode.h
@@ -87,6 +87,21 @@ void reinit_unicode(const char *LANG) FAST_FUNC;
87# undef MB_CUR_MAX 87# undef MB_CUR_MAX
88# define MB_CUR_MAX 6 88# define MB_CUR_MAX 6
89 89
90#if ENABLE_PLATFORM_MINGW32
91 #undef wint_t
92 #undef mbstate_t
93 #undef mbstowcs
94 #undef wcstombs
95 #undef wcrtomb
96 #undef iswspace
97 #undef iswalnum
98 #undef iswpunct
99 #undef wcwidth
100
101 #undef wchar_t
102 #define wchar_t uint32_t /* keep in sync with MINGW_BB_WCHAR_T */
103#endif
104
90/* Prevent name collisions */ 105/* Prevent name collisions */
91# define wint_t bb_wint_t 106# define wint_t bb_wint_t
92# define mbstate_t bb_mbstate_t 107# define mbstate_t bb_mbstate_t