Commit Graph

200 Commits

Author SHA1 Message Date
Piotr Caban 2c35caa767 msvcrt: Remove MSVCRT_ prefix from exit.c functions.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-02 15:37:19 +01:00
Piotr Caban eabef91a97 msvcrt: Use ctype definition from public header.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-01 14:01:57 +01:00
Piotr Caban d784dbb899 msvcrt: Remove MSVCRT_ prefix from heap.c functions.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-01 14:00:31 +01:00
Piotr Caban e9a1ff1130 msvcrt: Use locale category definiotion from public header.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-30 21:36:12 +01:00
Piotr Caban fa272adaeb msvcrt: Use simple type definitions from public header.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-27 21:59:39 +01:00
Piotr Caban b0a302ccea msvcrt: Use wide-char string literals.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-27 21:59:39 +01:00
Piotr Caban c302397c73 msvcrt: Remove MSVCRT_wchar_t type.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-27 21:59:39 +01:00
Piotr Caban 17f3f54886 msvcrt: Remove MSVCRT prefix from locale functions.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-26 23:25:38 +01:00
Piotr Caban 5114c85a03 msvcrt: Remove MSVCRT__locale_t type.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-26 23:25:38 +01:00
Piotr Caban d496099c74 msvcrt: Remove MSVCRT_pthreadmbcinfo type.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-26 23:25:38 +01:00
Piotr Caban d5c0458bd1 msvcrt: Remove MSVCRT_pthreadlocinfo type.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-26 23:25:38 +01:00
Piotr Caban 70c06601e6 msvcrt: Remove MSVCRT_lconv type.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-26 23:25:38 +01:00
Piotr Caban 1f5930af51 msvcrt: Move towctrans to wcs.c file.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-26 23:25:38 +01:00
Piotr Caban 3073097d29 msvcrt: Move btowc implementation to mbcs.c file.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-26 23:25:38 +01:00
Piotr Caban 40d4fbe459 msvcrt: Simplify get_current_locale_noalloc implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-25 22:51:35 +01:00
Piotr Caban a7f124eb5e msvcrt: Make old locale access thread-safe in setlocale.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-25 22:51:35 +01:00
Piotr Caban a9dfe7aba2 msvcrt: Reimplement _configthreadlocale function.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-25 22:51:35 +01:00
Piotr Caban bcd0096d09 msvcrt: Return thread locale copy in get_locinfo and get_mbcinfo.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-25 22:51:35 +01:00
Piotr Caban d5b2c3f233 msvcrt: Lock _MB_CP_LOCK lock in setmbcp.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-25 22:51:35 +01:00
Piotr Caban 4fc2b72933 msvcrt: Introduce flags field to describe locale stored in thread data.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-25 22:51:35 +01:00
Piotr Caban 6e70b04c68 msvcrt: Fix C locale lc_time_curr refconting.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-25 22:51:35 +01:00
Piotr Caban aa88917830 msvcrt: Update lc_category.wrefcount in __get_current_locale.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50163
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-23 12:36:40 +01:00
Alexandre Julliard 0edef50dfa msvcrt: Use the public standard type definitions where possible in msvcrt.h.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-20 19:01:04 +01:00
Alexandre Julliard 1f11f41f61 msvcrt: Remove some duplicate definitions from msvcrt.h.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-20 13:17:10 +01:00
Piotr Caban 35a8f15361 msvcrt: Don't overwrite threadmbcinfostruct structure in _setmbcp.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-19 21:24:09 +01:00
Alexandre Julliard 191bdeaff3 msvcrt: Build with msvcrt headers.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-19 21:23:22 +01:00
Alexandre Julliard 6482ce7666 msvcrt: Enable multi-thread locking by default.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-19 21:23:21 +01:00
Piotr Caban 216b9cb080 msvcrt: Lock global locale in _get_current_locale.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-18 22:27:51 +01:00
Chip Davis df2b13fa77 msvcrt: Increment refcounts for all locale data in _get_current_locale().
Signed-off-by: Chip Davis <cdavis@codeweavers.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-18 22:27:51 +01:00
Piotr Caban 16598c2af6 msvcrt: Simplify category checks in create_locinfo.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-18 22:27:51 +01:00
Chip Davis f248221870 msvcrt: Swap the threadlocinfo pointers in setlocale().
Do this instead of swapping their contents. This way, the result of
_get_current_locale(), which references the current threadlocinfo, won't
change after a setlocale() call.

Signed-off-by: Chip Davis <cdavis@codeweavers.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-18 22:27:51 +01:00
Chip Davis 898abfc18f msvcrt: Share __lc_time_data between threadlocinfo instances.
My testing shows that unk[1] is some sort of refcount.

Signed-off-by: Chip Davis <cdavis@codeweavers.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-18 22:27:51 +01:00
Chip Davis 10cac0a08f msvcrt: Share lconv data between threadlocinfo instances.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-18 22:27:50 +01:00
Chip Davis 5ec7cb5a7f msvcrt: Share ctype tables between threadlocinfo instances.
Signed-off-by: Chip Davis <cdavis@codeweavers.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-18 22:27:50 +01:00
Chip Davis 3e3f6396d2 msvcrt: Copy LC_COLLATE codepage between threadlocinfo instances.
Signed-off-by: Chip Davis <cdavis@codeweavers.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-18 22:27:50 +01:00
Chip Davis 9cb112ca25 msvcrt: Share locale names between threadlocinfo instances.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-18 22:27:50 +01:00
Piotr Caban 8455926662 msvcrt: locinfo->lc_name should be guarded by lc_category->wrefcount.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-18 22:27:48 +01:00
Piotr Caban 3ecede0c61 msvcrt: Call set_lc_locale_name in update_threadlocinfo_category.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-18 20:29:32 +01:00
Charles Davis db55e07016 msvcrt: Make locale name string refcounted for C locale.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-18 20:29:24 +01:00
Piotr Caban b0622bb49a msvcrt: Mark old_locinfo as const in create_locinfo.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-18 20:29:09 +01:00
Alexandre Julliard f48648aeec msvcrt: Use the msvcrt atoi() function internally.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-18 20:28:05 +01:00
Alexandre Julliard 871d9863bc msvcrt: Use the msvcrt allocation functions internally.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-18 20:28:05 +01:00
Piotr Caban e460b37a25 ucrtbase: Add support for utf8 codepage in setlocale.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-11 21:14:58 +01:00
Rémi Bernon faf92fdedb msvcrt: Introduce noalloc current locale lookup helpers.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-10 17:19:44 +01:00
Rémi Bernon a24ad51e3f msvcrt: Make locale and thread helper functions CDECL.
This prevent callers from having to save SSE registers to the stack.

It is for instance the case in MSVCRT__towlower_l, which is called on
every character by MSVCRT__wcsicmp_l.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-10 17:19:44 +01:00
Piotr Caban dc11755390 msvcrt: Use default user locale when only codepage is passed to setlocale.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-18 22:07:43 +02:00
Piotr Caban 536be09b84 msvcrt: Don't use wine/unicode.h header.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-21 15:17:51 +02:00
Piotr Caban 59ee87877c msvcrt: Improve __crtLCMapStringA implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 00:04:13 +02:00
Piotr Caban bfa1e3ef8f msvcrt: Use internal sprintf implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-08 21:01:33 +02:00
Chip Davis 0216290675 msvcrt: Fix the btowc() function.
This function returns WEOF on conversion failure. It should only operate
on single-byte characters in the C locale. Finally, it should use the
current locale's codepage, instead of the current locale itself, to do
conversions.

Signed-off-by: Chip Davis <cdavis@codeweavers.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-29 20:31:43 +01:00