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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>