diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2005-04-24 11:30:27 +0000 |
---|---|---|
committer | Danny Smith <dannysmith@users.sourceforge.net> | 2005-04-24 11:30:27 +0000 |
commit | 6fbeb6a3f07e9c5c62966e8bf2a4ecfd367f23a9 (patch) | |
tree | ed637eb4a0126508546e5c4100176eb1123ec931 /winsup/mingw/mingwex/mb_wc_common.h | |
parent | 4fc953d6a1448be843847bfbd29e022d78134eee (diff) | |
download | cygnal-6fbeb6a3f07e9c5c62966e8bf2a4ecfd367f23a9.tar.gz cygnal-6fbeb6a3f07e9c5c62966e8bf2a4ecfd367f23a9.tar.bz2 cygnal-6fbeb6a3f07e9c5c62966e8bf2a4ecfd367f23a9.zip |
* mingwex/mbrtowc.c: New file.
* mingwex/wcrtomb.c: New file.
* mingwex/btowc.c: New file.
* mingwex/wctob.c: New file.
* mingwex/mb_wc_common.h: New file.
* mingwex/Makefile.in (DISTFILES): Add new files.
(Q8_OBJS): Add new objects.
* include/wchar.h: Adjust comment about mbrtowc() and related
funcions. Add __restrict__ to pointer params in prototypes.
(wmemset. wmemchr, wmemcpy, wmemmove, wcstoll, wcstoull): Remove
arg names from protototypes.
Diffstat (limited to 'winsup/mingw/mingwex/mb_wc_common.h')
-rwxr-xr-x | winsup/mingw/mingwex/mb_wc_common.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/winsup/mingw/mingwex/mb_wc_common.h b/winsup/mingw/mingwex/mb_wc_common.h new file mode 100755 index 000000000..a4ea81cf2 --- /dev/null +++ b/winsup/mingw/mingwex/mb_wc_common.h @@ -0,0 +1,18 @@ +#include <locale.h> +#include <string.h> +#include <stdlib.h> + +static inline +unsigned int get_cp_from_locale (void) +{ + char* cp_string; + /* + locale :: "lang[_country[.code_page]]" + | ".code_page" + + */ + + if ((cp_string = strchr(setlocale(LC_CTYPE, NULL), '.'))) + return ((unsigned) atoi (cp_string + 1)); + return 0; +} |