Commit Graph

3012 Commits

Author SHA1 Message Date
Piotr Caban d81afa52ec msvcrt/tests: Build without -DWINE_NO_LONG_TYPES.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-14 11:04:19 +01:00
Piotr Caban 4397d97d91 msvcrt: Print 0x prefix with %#x format in traces.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-08 20:24:15 +01:00
Piotr Caban 83fb79d41d msvcrt: Use %#I64x format in traces.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-08 20:24:15 +01:00
Eric Pouech 9b802a3d56 msvcr: Build without -DWINE_NO_LONG_TYPES.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-08 20:24:15 +01:00
Piotr Caban a656a8b644 ucrtbase: Add support for r-value demangling in unDName.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=44202
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-07 20:18:17 +01:00
Eric Pouech 948f465da7 msvcrt: Use correct integral type in _except1.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-04 19:42:01 +01:00
Eric Pouech 9ddcbb5f64 msvcr*: Use correct integral type in Interlocked* calls.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-04 19:42:01 +01:00
Eric Pouech 29541adafa msvcrt: Add casts to avoid 'long' types warning in locale functions.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-03 21:06:11 +01:00
Eric Pouech 800971f934 msvcrt: Add cast to avoid 'long' types warning in _beginthreadex.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-03 21:06:02 +01:00
Eric Pouech d7dad50544 msvcrt: Use correct integral types in structs.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-03 21:05:27 +01:00
Piotr Caban 3fbfddbd53 msvcrt: Use InitOnceExecuteOnce to allocate TLS index.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-03 17:19:41 +01:00
Piotr Caban 201266769d msvcrt: Don't use fegetenv in nearbyintf.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-01 18:23:18 +01:00
Piotr Caban 5d9d195f49 msvcrt: Don't use fegetenv in nearbyint.
The fegetenv/feupdateenv functions are broken in msvcr120 and are
causing unintentional SSE control word changes.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-01 18:23:18 +01:00
Piotr Caban e617fe0bda msvcrt: Don't set SSE control word in _except1.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-01 18:23:18 +01:00
Piotr Caban f12bcfd2ab msvcrt: Fix fmaf not to depend on rounding mode.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-01 18:23:18 +01:00
Alexandre Julliard f0cd33c69e include: Add support for defining Win32 types as 'long' where possible.
Add -DWINE_NO_LONG_TYPES to modules that still have compilation
warnings with long types.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-27 20:38:22 +01:00
Piotr Caban 80eec636ee msvcrt: Fix Pi constants while computing acosf.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-19 16:27:16 +01:00
Piotr Caban 64c6deda5d msvcrt: Add support for demangling char{8,16,32}_t types.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-19 16:27:13 +01:00
Jacek Caban 907859d7cb msvcrt: Use __WINE_PE_BUILD in crt_gccmain.c.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52292
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-03 19:07:06 +01:00
Piotr Caban 7555573dc5 msvcrt: Fix restoring 53-bit precision mode in _control87.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52260
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-23 22:57:01 +01:00
Piotr Caban c521ec04c9 msvcrt: Make _setfp* helpers infallible.
The functions may only fail on unsupported compilers/architectures. It's
not really possible to handle errors properly.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-21 13:32:08 +01:00
Piotr Caban 564ede5d32 msvcrt: Don't set _EM_AMBIGOUS flag in _control87 when sse2 is not supported.
Fixes compilation warning.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-21 13:32:08 +01:00
Eric Pouech 01111b941d msvcrt: Fix double-free and memory leak in type_info destructor.
Spotted by toying with the gcc's static analyzer.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-16 20:44:27 +01:00
Piotr Caban 2f2891e5d5 msvcrt: Fix _strtime implementation in Hindi locale.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-13 17:58:22 +01:00
Piotr Caban 0e9431b809 msvcrt: Fix _strdate implementation in Hindi locale.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-13 17:58:22 +01:00
Piotr Caban c0ea1ad37d msvcr100: Add _Timer class implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-30 22:07:21 +01:00
Piotr Caban acc7907dc9 msvcrt: Skip small-block heap tests if _set_sbh_threshold is not available.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49181
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-19 18:31:38 +01:00
Alexandre Julliard 3ebc80f148 msvcrt: Don't forward itoa() functions to ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-17 15:19:33 +01:00
Alexandre Julliard 68559674e7 msvcrt: Don't forward string functions to ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-17 15:19:33 +01:00
Thomas Faber be0684dad5 msvcrt/tests: Show that spawn does not require locking of fds.
Signed-off-by: Thomas Faber <thomas.faber@reactos.org>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-12 22:42:52 +01:00
Doug Lyons 5a514d3f45 msvcrt: Do not acquire fd lock in msvcrt_create_io_inherit_block.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51647
Signed-off-by: Doug Lyons <douglyons@douglyons.com>
Signed-off-by: Thomas Faber <thomas.faber@reactos.org>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-12 22:42:52 +01:00
Martin Storsjö 6a072b98c1 msvcrt: Don't set frame to 0 in arm and arm64 setjmp.
This matches what was done for x86_64 in
882980c17a.

Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-09 22:02:56 +01:00
Arkadiusz Hiler 04bb9112d2 msvcrt: Increase module's reference count before returning from _beginthread[ex]().
Increasing DLL's reference count from the trampoline function makes it
prone to race conditions. The thread can start executing after we have
already returned from _beginthread[ex]() and the DLL might have been
freed.

Fixes rare crash on launch with Baldur's Gate 3.

Signed-off-by: Arkadiusz Hiler <ahiler@codeweavers.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-08 20:40:09 +01:00
Andrew Eikum 0c6bab9339 msvcrt: Better handle multiple width specifiers.
Includes feedback from David Gow <david@davidgow.net> and Piotr Caban.

Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-08 17:33:56 +01:00
Piotr Caban 00824a94f0 msvcrt: Don't use GetDaylightFlag function in _ftime64.
The function is not available on current Windows releases.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51959
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-01 20:45:32 +01:00
Rémi Bernon 7c046c7afd msvcrt: Write memory forward in memset.
Instead of going backward, which breaks the Linux kernel transparent
huge pages allocation assumptions.

This can be reproduced by calling memset on large, newly allocated,
memory regions.

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>
2021-10-25 21:16:29 +02:00
Piotr Caban e38f3761f8 msvcrt: Rewrite _popen function.
Old implementation was not thread safe, incorrectly copied file
descriptors to child process and was leaking parent pipe fd to child
process.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51719
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-25 18:53:19 +02:00
Piotr Caban 1420d28cd6 msvcrt: Fix clearing NOINHERIT flag in _dup2.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-25 18:53:10 +02:00
Alexandre Julliard d8ed47ec21 msvcrt: Use the standard va_list instead of __ms_va_list.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-22 11:12:09 +02:00
Eric Pouech 74a42c5401 msvcrt: Support I width modifier in *scanf* family.
Despite what msdn states, I and I32 are supported width modifiers.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-20 20:11:28 +02:00
Piotr Caban 21da1f2f11 ucrtbase: Avoid bool optimization in __std_exception_copy.
Otherwise GCC changes do_free = 1 assignment to *dst = *src which breaks
ucrtbase/cpp tests.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-18 16:02:25 +02:00
Piotr Caban 7a98557352 ucrtbase: Change _isblank_l return value for '\t'.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-18 16:02:03 +02:00
Alexandre Julliard 2a92c58e11 include: Use the standard va_list instead of __ms_va_list when building with msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-15 18:28:01 +02:00
Alexandre Julliard da8176df61 msvcrt: Move _fdclass/_dclass to avoid forward references.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-15 18:28:00 +02:00
Alexandre Julliard 84bfdccf6d include: Add prototypes for the byteswap functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-13 18:41:02 +02:00
Ted Lyngmo 51b9f4cd2b ucrtbase: Add support for x mode in fopen.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51846
Signed-off-by: Ted Lyngmo <ted@lyncon.se>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-11 19:43:01 +02:00
Piotr Caban bb637469e1 msvcrt: Don't crash on NULL in fclose.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-11 19:42:26 +02:00
Alexandre Julliard 97479d3d32 ntdll: Move some exception definitions to winternl.h.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-07 13:52:42 +02:00
Piotr Caban 5d5f11c002 msvcrt: Support z length modifier in scanf.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-21 11:43:12 +02:00
Alexandre Julliard 088a787a2c makefiles: Make -mno-cygwin the default.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:48 +02:00