1
0
mirror of https://git.code.sf.net/p/mingw-w64/mingw-w64 synced 2025-04-18 17:44:18 +03:00

8178 Commits

Author SHA1 Message Date
LIU Hao
d7e849d00c
Revert "headers/{ctype,tchar}: Declare isblank-family functions"
This reverts commit 3839e21b08807479a31d5a9764666f82ae2f0356.
2025-02-24 17:55:55 +08:00
LIU Hao
3839e21b08
headers/{ctype,tchar}: Declare isblank-family functions
These functions are exported from MSVCR120+ and UCRT DLLs.

When using MSVCR110-, we have custom implementations of `isblank()` and
`iswblank()`. Previously, these were only declared for C99 or C++. To avoid
complication in <tchar.h>, they are now declared unconditionally.

Signed-off-by: LIU Hao <lh_mouse@126.com>
2025-02-23 19:29:43 +08:00
LIU Hao
3346c0eb95
headers/ctype: Add _CRTIMP to imported functions
These functions do not seem to be implemented in our code anywhere, so they
must be always imported from Microsoft DLLs.

The changes can be verified with `git show --color-words'.

Signed-off-by: LIU Hao <lh_mouse@126.com>
2025-02-23 19:29:25 +08:00
Biswapriyo Nath
35270b8651
headers: Add RoGetAgileReference in combaseapi.h
Required for 74cac7296d

Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2025-02-23 19:27:38 +08:00
LIU Hao
9c006fc76b
winpthreads: Regenerate configure and friends
Signed-off-by: LIU Hao <lh_mouse@126.com>
2025-02-19 23:26:28 +08:00
Kirill Makurin
9b2f5580ce
winpthreads: handle pthread alias during installation
Remove definition of Automake conditionals COPY_STATIC and COPY_SHARED
from configure.ac as they are no longer used.

Remove SUBST([LT_OBJDIR]) from configure.ac as it is no longer needed.

Signed-off-by: Kirill Makurin <maiddaisuki@outlook.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2025-02-19 23:24:15 +08:00
Biswapriyo Nath
0f94270b00
headers: Add new constants in winnt.rh
Required for https://github.com/TypesettingTools/Aegisub/blob/v3.4.2/src/res/strings_utf8.rc#L60
Reported here https://github.com/msys2/MINGW-packages/issues/23420

Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2025-02-18 21:40:35 +08:00
Kirill Makurin
576ba0e3e5
winpthreads: do not include sys/timeb.h from public headers
Signed-off-by: Kirill Makurin <maiddaisuki@outlook.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2025-02-18 21:38:37 +08:00
LIU Hao
079e6092b3
crt: Regenerate Makefile.in
Signed-off-by: LIU Hao <lh_mouse@126.com>
2025-02-16 15:20:32 +08:00
Biswapriyo Nath
556004c15e
crt: Add wiaguid library
This adds wiaguid library to make things similar as SDK. The same source
file is used in uuid library but it is kept for compatibility.

Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2025-02-16 15:19:33 +08:00
Biswapriyo Nath
350d71bbea
headers: Fix NUMA_NODE_RELATIONSHIP and CACHE_RELATIONSHIP in winnt.h
Fixes https://github.com/mingw-w64/mingw-w64/issues/78

Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2025-02-16 15:10:22 +08:00
Biswapriyo Nath
4c328c71fd crt/libsrc: Include wia.h to get guids in wia-uuid.c
This helps to add new GUIDs in the library automatically from header file.

Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
2025-02-14 20:01:26 +01:00
Biswapriyo Nath
80191a01bd
include: Remove wia.h include check in wiadef.h
wia.h does not have the include guard macro after 5b5f0a1b1a2d403ccdc99aeba908355c19a86755 commit.
It was added in 1e1bd8da6fc45c110750b41c478dd8ac3e1829cc commit.

Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2025-02-14 22:24:41 +08:00
Biswapriyo Nath
5b5f0a1b1a headers: Import wia.h from Wine.
Required for https://github.com/msys2/MINGW-packages/issues/17451

Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
2025-02-14 12:32:13 +01:00
Jacek Caban
60c0e5320e headers: Update imported uiautomationclient.idl to current Wine version.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
2025-02-14 12:30:42 +01:00
Kirill Makurin
993da580b7
winpthreads: move definitions of error codes to pthread_compat.h
Keep compatibility stuff in pthread_compat.h

Signed-off-by: Kirill Makurin <maiddaisuki@outlook.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2025-02-11 13:22:20 +08:00
Kirill Makurin
13d95a244a
winpthreads: remove duplicated code from pthread.h
pthread.h contains most of the contents of sched.h verbatim.
Remove it and include sched.h instead.

Signed-off-by: Kirill Makurin <maiddaisuki@outlook.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2025-02-11 13:22:20 +08:00
Kirill Makurin
bd66593658
winpthreads: move includes under header guard in sched.h
Signed-off-by: Kirill Makurin <maiddaisuki@outlook.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2025-02-11 13:22:20 +08:00
Kirill Makurin
b285e5dfc7
winpthreads: use WINPTHREAD_API instead of WINPTHREAD_SEMA_API in semaphore.h
Signed-off-by: Kirill Makurin <maiddaisuki@outlook.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2025-02-11 13:22:20 +08:00
Kirill Makurin
cb1cab3542
winpthreads: use WINPTHREAD_API instead of WINPTHREAD_SCHED_API in sched.h
Signed-off-by: Kirill Makurin <maiddaisuki@outlook.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2025-02-11 13:22:20 +08:00
Kirill Makurin
a3cc72715f
winpthreads: move declaration of mode_t to pthread_compat.h
Keep all MSVC compatibility stuff in pthread_compat.h.

Signed-off-by: Kirill Makurin <maiddaisuki@outlook.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2025-02-11 13:22:20 +08:00
Martin Storsjö
423ef73a3f crt: Mark _tls_index as used for LTO
If translation units that use thread local variables are built with
LTO (using native TLS, not emulated TLS), then the implicit access
to _tls_index isn't visible on the LTO object file level.

Therefore, mark _tls_index as used, so that it gets retained through
LTO.

This fixes linking user code with LTO, if the base CRT files also
are built with LTO enabled.

This is similar to 7ef0ba478f664a78a8509c81d5e40a34e821ac8c which
marked _tls_used as used too.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-02-10 23:22:52 +02:00
Martin Storsjö
7a24d53cc3 crt: Regenerate Makefile.in
Signed-off-by: Martin Storsjö <martin@martin.st>
2025-02-10 23:19:29 +02:00
Martin Storsjö
78827c39fe crt: Call the regular sin()/cos() functions in sincos() on UCRT/x86
On UCRT, we pass calls to sin()/cos() to the CRT; the UCRT
versions of these functions are faster than our x87 implementations.

The same also goes for sincos(); calling the UCRT sin() and cos()
from UCRT separately is almost 3x as fast as calling the x87
sincos() implementation.

Using assembly for implementing these functions; a plain C
version can be optimized by the compiler back into a plain call
to sincos() (GCC does by default, Clang does it if compiling with
-ffast-math), see 3f40dd3254582722761606c7c99d658f952002d9 for
earlier precedent for arm/aarch64.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-02-10 23:19:26 +02:00
Martin Storsjö
e6cf1f9d80 crt: Split out the sincosl() function from sincos() and sincosf()
Signed-off-by: Martin Storsjö <martin@martin.st>
2025-02-10 23:19:21 +02:00
Kirill Makurin
59137ec47e
Update Makefile.am in mingw-w64-libraries/winpthreads/tests
Add -L$(top_builddir)/fakelib to AM_LDFLAGS only when NOT using MSVC tools.

Signed-off-by: Kirill Makurin <maiddaisuki@outlook.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2025-02-09 18:51:44 +08:00
Jacek Caban
e3385b680f headers: Update imported headers to Wine 10.1. 2025-02-09 11:45:25 +01:00
Kirill Makurin
144667408b
winpthreads: move definition of WINPTHREAD_API to pthread_compat.h
Signed-off-by: Kirill Makurin <maiddaisuki@outlook.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2025-02-09 17:36:02 +08:00
Kirill Makurin
efdaf34086
winpthreads: move declaration of clockid_t to pthread_compat.h
- remove redundant declarations of clockid_t from pthread.h and pthread_time.h

Signed-off-by: Kirill Makurin <maiddaisuki@outlook.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2025-02-09 17:36:00 +08:00
Kirill Makurin
0bf22b5909
winpthreads: do not include pthread_time.h from pthread_compat.h
- remove redundant declaration of clockid_t from pthread_compat.h
- explicitly include pthread_time.h from pthread.h when compiling with MSVC

Signed-off-by: Kirill Makurin <maiddaisuki@outlook.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2025-02-09 17:35:58 +08:00
Biswapriyo Nath
9e8f2a7b5d
headers: Add new symbols in mapi.h
Fixes https://github.com/mingw-w64/mingw-w64/issues/75

Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2025-02-07 21:12:13 +08:00
Martin Storsjö
4f986950a4 headers: Use a more unique name for the __PASTE macro
The previous name, __PASTE, conflicts with the NSS library, which
contains a header that also uses this name. The NSS header first
defines __PASTE to an expansion similar to ours, but then later
undefines __PASTE again, which breaks any further mingw header.

This fixes building NSS after mingw-w64 commit
8f441a62f1b474a29d61571d0da806193ce7ca1c.

Technically, the issue lies with NSS - the namespace of identifiers
starting with two underscores is reserved for the toolchain, where
user code shouldn't be using it.

However, to pragmatically avoid breaking existing code, use a more
unique name for the define in our headers.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-02-06 14:20:25 +02:00
LIU Hao
6cda373a9e
headers/dxvahd: Regenerate H from IDL
Signed-off-by: LIU Hao <lh_mouse@126.com>
2025-02-04 17:28:20 +08:00
Steve Lhomme
ba3e7b1250
headers/dxvahd: Add missing WINAPI on DXVAHD_CreateDevice()
Signed-off-by: LIU Hao <lh_mouse@126.com>
2025-02-04 17:27:18 +08:00
Steve Lhomme
44572d1a0a
crt: add missing DXVAHD_CreateDevice for x86
It was first added to arm32 in 4a306baa4a206c9314bdc129e98abfa1aebe2b0e.
Then to the common one in 96fe9ec413001bfc3f5971df64bcdedc216a9020.
But it was always missing in x86.

I verified that's the only one missing in that .def.

Signed-off-by: LIU Hao <lh_mouse@126.com>
2025-02-04 17:27:18 +08:00
Kirill Makurin
91333f91ab
tests: mingw-w64-libraries/winpthreads/tests/t_nanosleep.c
Use winpthreads' clock_gettime instead of non-standard getntptimeofday.

Signed-off-by: Kirill Makurin <maiddaisuki@outlook.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2025-02-04 17:23:29 +08:00
Kirill Makurin
4a31a63686
headers: Fix mingw-w64-libraries/winpthreads/src/thread.h
Move WINPTHREAD_API left to return type of __pth_gpointer_locked so
cl.exe does not choke with C2059 (syntax error).

Signed-off-by: Kirill Makurin <maiddaisuki@outlook.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2025-02-04 17:23:26 +08:00
Pali Rohár
ea22a99cb0 crt: Replace repeated code for loading of msvcrt.dll function by common code from msvcrt_or_emu_glue.h
Signed-off-by: Martin Storsjö <martin@martin.st>
2025-01-28 23:46:52 +02:00
Pali Rohár
8f441a62f1 crt: Add new crt header file msvcrt_or_emu_glue.h which generates common code for loading msvcrt function or using it emulation
Signed-off-by: Martin Storsjö <martin@martin.st>
2025-01-28 23:46:52 +02:00
Daniel Starke via Mingw-w64-public
be91da60c4
headers: Fix wrong return type for PathQuoteSpacesA and PathQuoteSpacesW
[1] describes PathQuoteSpacesA with return type BOOL and
[2] describes PathQuoteSpacesW with return type BOOL.

Both functions are currently declared with return type void in shlwapi.h.

Fix this by using LWSTDAPI_(WINBOOL) as return type similar to the other
functions in that header.

This fixes bug report 999. See [3].

[1]: https://learn.microsoft.com/en-us/windows/win32/api/shlwapi/nf-shlwapi-pathquotespacesa
[2]: https://learn.microsoft.com/en-us/windows/win32/api/shlwapi/nf-shlwapi-pathquotespacesw
[3]: https://sourceforge.net/p/mingw-w64/bugs/999/

Fixes: 9d937a7f4f76 ("Add mingw-w64 header set as initial set.")
Signed-off-by: Daniel Starke <daniel-email@gmx.net>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2025-01-15 09:26:18 +08:00
Martin Storsjö
9f56d8ee70 crt: Regenerate Makefile.in
Signed-off-by: Martin Storsjö <martin@martin.st>
2025-01-13 17:45:12 +02:00
Pali Rohár
4a02853931 crt: Fix __(w)getmainargs wrappers for msvcrt40.dll/msvcrt.dll
Enusure that the output arguments are not changed on the library
__(w)getmainargs function failure.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-01-13 17:42:50 +02:00
Pali Rohár
d217fb16c1 crt: Fix msvcrt40.dll __(w)getmainargs() ABI for Windows XP and new
All 32-bit Windows NT systems contains system OS library msvcrt40.dll which
should be compatible with the original Visual C++ 4.0/4.1 msvcrt40.dll library.

The Windows NT implementation of msvcrt40.dll is very simple, it just
redirects function calls via symbol forwarding to msvcrt.dll library.

Since Windows XP, the msvcrt.dll changed ABI of __getmainargs() and
__wgetmainargs() functions, and so it is required also for msvcrt40.dll
builds to include ABI fix code which is already used for msvcrt.dll builds.

Windows systems do not provide msvcr40d.dll and neither msvcrtd.dll
libraries, so for these builds there is no need to do new wrappers.
But for simplification of our build system, which does not have separate
source file definitions for msvcrt40.dll and msvcr40d.dll, use same
wrappers also for msvcr40d.dll and msvcrtd.dll.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-01-13 17:41:05 +02:00
Lasse Collin
9c93e483bc
crt: wctob: Fix return value for negative char values
Signed-off-by: LIU Hao <lh_mouse@126.com>
2025-01-12 17:27:06 +08:00
Pali Rohár
ce0d0bfb70 crt: Fix return type of __mingw_get_msvcrt_handle() function
Function GetModuleHandle() returns HMODULE, not HANDLE.
So function __mingw_get_msvcrt_handle() has to also return HMODULE.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-01-11 01:02:22 +02:00
Pali Rohár
f083c4afdf crt: Use GetModuleHandleA() in __mingw_get_msvcrt_handle()
This allows to get msvcrt module also on non-NT systems, on which
GetModuleHandleW() always returns NULL.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-01-11 01:02:22 +02:00
Pali Rohár
4b688cfaea crt: Add include guard for msvcrt.h file
This allow to include msvcrt.h more times.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-01-11 01:02:22 +02:00
Jacek Caban
b792be3485 headers: Add RtlIsEcCode declaration.
Based on patch by Billy Laws.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
2025-01-10 14:27:59 +01:00
Martin Storsjö
33605cde26 crt: Regenerate Makefile.in
Signed-off-by: Martin Storsjö <martin@martin.st>
2025-01-10 14:54:41 +02:00
Pali Rohár
3caba2fa06 crt: Split fseeki64.c into _fseeki64.c and _ftelli64.c
File fseeki64.c provides two functions _fseeki64() and _ftelli64().
Function _fseeki64() is available in all CRT ARM versions, including system
msvcrt.dll. For x86 versions, it is available since msvcr80.dll, for system
msvcrt.dll it is disabled for backward compatibility. Function _ftelli64()
is available since msvcr80.dll, and is not part of system msvcrt.dll.

Split this file fseeki64.c into two files _fseeki64.c and _ftelli64.c. And
compile each just for import CRT libraries which do not have required
function. ARM ifdef for _fseeki64 was replaced by not including it into ARM
version of msvcrt.dll.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-01-10 14:54:19 +02:00