Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2009-05-14 23:49:37 +0400
committerCorinna Vinschen <corinna@vinschen.de>2009-05-14 23:49:37 +0400
commit6f401eccfb260b64a35a55e54e0e403324921690 (patch)
tree2438b25becaba143df2ce7bb2ad0708aa41e1c94 /winsup/cygwin/wchar.h
parentef5da523a94f878fbe95aac85eeb82d9a129ab6b (diff)
* cygheap.cc (cygheap_init): Set Cygwin default locale values.
* cygheap.h (struct cygheap_locale): New structure. (struct user_heap_info): Add cygheap_locale member locale. * dcrt0.cc (dll_crt0_1): Revert to calling _setlocale_r so that only the applications locale is reverted to "C". * environ.cc (environ_init): Remove unused got_lc variable. * fhandler.h (class dev_console): Remove now unsed locale variables. * fhandler_console.cc (fhandler_console::get_tty_stuff): Remove setting dev_console's locale members. (dev_console::con_to_str): Use internal locale settings. Default to __ascii_wctomb if charset is "ASCII". (fhandler_console::write_normal): Ditto. * strfuncs.cc (__ascii_wctomb): Drop declaration. (__db_wctomb): Use fixed value 2 instead of not necessarily matching MB_CUR_MAX. (__eucjp_wctomb): Use 3 instead of MB_CUR_MAX. (sys_cp_wcstombs): Remove special case for "C" locale. (sys_wcstombs): Implement here. Use internal locale data stored on cygheap. (sys_cp_mbstowcs): Remove special case for "C" locale. (sys_mbstowcs): Implement here. Use internal locale data stored on cygheap. * syscalls.cc (internal_setlocale): New function to set cygheap locale data and to reset CWD posix path. (setlocale): Just call internal_setlocale from here if necessary. * wchar.h (__ascii_wctomb): Declare. (sys_wcstombs): Don't define inline, just declare. (sys_mbstowcs): Ditto.
Diffstat (limited to 'winsup/cygwin/wchar.h')
-rw-r--r--winsup/cygwin/wchar.h19
1 files changed, 7 insertions, 12 deletions
diff --git a/winsup/cygwin/wchar.h b/winsup/cygwin/wchar.h
index 064b8df62..4c720cbc8 100644
--- a/winsup/cygwin/wchar.h
+++ b/winsup/cygwin/wchar.h
@@ -34,6 +34,7 @@ typedef int wctomb_f (struct _reent *, char *, wchar_t, const char *,
typedef wctomb_f *wctomb_p;
extern wctomb_p __wctomb;
+extern wctomb_f __ascii_wctomb;
extern wctomb_f __utf8_wctomb;
extern char *__locale_charset ();
@@ -48,12 +49,9 @@ extern mbtowc_p __set_charset_from_codepage (unsigned int cp, char *charset);
size_t __stdcall sys_cp_wcstombs (wctomb_p, char *, char *, size_t,
const wchar_t *, size_t = (size_t) -1)
__attribute__ ((regparm(3)));
-inline size_t
-__stdcall sys_wcstombs (char *dst, size_t len, const wchar_t * src,
- size_t nwc = (size_t) -1)
-{
- return sys_cp_wcstombs (__wctomb, __locale_charset (), dst, len, src, nwc);
-}
+size_t __stdcall sys_wcstombs (char *dst, size_t len, const wchar_t * src,
+ size_t nwc = (size_t) -1)
+ __attribute__ ((regparm(3)));
size_t __stdcall sys_wcstombs_alloc (char **, int, const wchar_t *,
size_t = (size_t) -1)
__attribute__ ((regparm(3)));
@@ -61,12 +59,9 @@ size_t __stdcall sys_wcstombs_alloc (char **, int, const wchar_t *,
size_t __stdcall sys_cp_mbstowcs (mbtowc_p, char *, wchar_t *, size_t,
const char *, size_t = (size_t) -1)
__attribute__ ((regparm(3)));
-inline size_t
-sys_mbstowcs (wchar_t * dst, size_t dlen, const char *src,
- size_t nms = (size_t) -1)
-{
- return sys_cp_mbstowcs (__mbtowc, __locale_charset (), dst, dlen, src, nms);
-}
+size_t sys_mbstowcs (wchar_t * dst, size_t dlen, const char *src,
+ size_t nms = (size_t) -1)
+ __attribute__ ((regparm(3)));
size_t __stdcall sys_mbstowcs_alloc (wchar_t **, int, const char *,
size_t = (size_t) -1)
__attribute__ ((regparm(3)));