This commit moves `__mingw_has_sse()` to a separate file, and makes its
result cacheable.
SSE is required for x86-64, and can be enabled for x86-32 by passing `-msse`
to GCC. On ARM and ARM64 it's always absent. A macro is defined if it would
be known to return a constant.
Co-authored-by: Morilli <molli.bender@gmail.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
Fix ULongToChar to return -1 on overflow, like it does in the SDK.
Fix LongLongToUIntPtr and LongLongToULongPtr so they work on 32-bit.
Remove about 150 macros added this year that just redefine an existing function.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
45629c13ef added this macro in tbs.h, causing
a warning about redefinition:
mingw-w64-headers/include/tbs.h:63: warning: "TBS_SUCCESS" redefined
63 | #define TBS_SUCCESS 0
No Windows SDK has this macro in winerror.h, so this macro in winerror.h
should be removed, and the one in tbs.h is preferred.
Signed-off-by: LIU Hao <lh_mouse@126.com>
The _l suffixed wchar ctype functions, such as _iswalpha_l,
are available in msvcrt.dll, but only since Vista. They're also
available in the properly versioned msvcrt versions since
msvcr80.dll.
This fixes building libc++ for msvcrt.dll, after the recent
changes in f1df976e39.
Signed-off-by: Martin Storsjö <martin@martin.st>
Now this file contains only tzset() and _tzset() functions and
tzname/timezone/daylight global variables.
Signed-off-by: Martin Storsjö <martin@martin.st>
Also add missing __MINGW_ATTRIB_NORETURN attribute into header file
internal.h where is function _amsg_exit() declared.
Signed-off-by: Martin Storsjö <martin@martin.st>
Pre-msvcr80.dll builds, including msvcrt.dll builds use _get_output_format()
implementation from mingw-w64 output_format.c source file. Use it also for
UCRT builds instead of current stub in ucrt_compat.c.
Signed-off-by: Martin Storsjö <martin@martin.st>
These functions and macros were added in MSVCR80.DLL and were not available
in MSVCRT.DLL from Windows XP.
This closes https://github.com/mingw-w64/mingw-w64/issues/60.
Signed-off-by: LIU Hao <lh_mouse@126.com>
For more D2DERR_* macros defined in d2derr.h, warnings is:
In file included from mingw-w64-headers/include/d2d1.h:20,
from mingw-w64-headers/include/d2d1_1.h:10,
from libsrc/uuid.c:29:
mingw-w64-headers/include/d2derr.h:16: warning: "D2DERR_BAD_NUMBER" redefined
#define D2DERR_BAD_NUMBER 0x88990011
In file included from mingw-w64-headers/include/winbase.h:2816,
from mingw-w64-headers/include/windows.h:70,
from mingw-w64-headers/include/rpc.h:16,
from mingw-w64-headers/include/credentialprovider.h:7,
from libsrc/uuid.c:17:
mingw-w64-headers/include/winerror.h:4713: note: this is the location of the previous definition
#define D2DERR_BAD_NUMBER _HRESULT_TYPEDEF_(0x88990011)
Add guards in winerror.h and d2derr.h to not define same macros multiple times.
Signed-off-by: LIU Hao <lh_mouse@126.com>
Header file sys/timeb_s.h defines _ftime_s only as a macro which expands
either to _ftime32_s or _ftime64_s based on _USE_32BIT_TIME_T setting.
MS VC++ 2005+ header files also defines only _ftime_s as a macro and do not
provide any _ftime_s function declaration or symbol alias in import library.
_ftime_s symbol alias is currently defined only in mingw-w64 msvcrt.def.in
file, not in any other .def file, neither in UCRT ones.
So _ftime_s symbol alias is not needed in msvcrt.def.in file, remove it.
Signed-off-by: Martin Storsjö <martin@martin.st>
This fixes the following compiler error with gecko.
mozilla-unified/widget/windows/ToastNotification.cpp:832:14: error: no matching member function for call to 'Set'
832 | hr = aumid.Set(mAumid.ref().get());
| ~~~~~~^~~
corewrappers.h:58:25: note: candidate function not viable: no known conversion from
'typename raw_type<char16_t, int>::type' (aka 'char16ptr_t') to 'const HSTRING' (aka 'HSTRING__ *const') for 1st argument
corewrappers.h:53:25: note: candidate function not viable: requires 2 arguments, but 1 was provided
Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
Now when there is working _onexit() function, provide also onexit() aliased
function, which already has declaration in stdlib.h header file.
Signed-off-by: Martin Storsjö <martin@martin.st>
MS documentation for _onexit function says:
In the case when _onexit is called from within a DLL, routines registered
with _onexit run when the DLL is unloaded, after DllMain is called with
DLL_PROCESS_DETACH.
And for this functionality msvc statically links _onexit functionality for
DLL builds, and do not let applications to use msvcrt.dll's _onexit symbol
directly.
Fix this issue in mingw-w64 by redefining _onexit function to calls private
mingw-w64 atexit() function, which already distinguish between EXE and DLL
builds. Include this _onexit function into every CRT import library and
disable original _onexit symbol in all def files.
Signed-off-by: Martin Storsjö <martin@martin.st>
When __CRT__NO_INLINE is enabled then ftime function ignored the
_USE_32BIT_TIME_T settings.
Fix this problem by declaring ftime function with __MINGW_ASM_CALL
attribute with correct alias based on _USE_32BIT_TIME_T settings.
With this change the inline variant of ftime function is not needed
anymore as it was just wrapper around aliased function, which is now
correctly resolved via __MINGW_ASM_CALL.
Signed-off-by: Martin Storsjö <martin@martin.st>