This reverts commit 0c7108c439
This revert fixes the build of SDL_net for x86 architecture.
Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: Liu Hao <lh_mouse@126.com>
The udf arm instruction has a platform specific meaning; on Windows
udf #0xfe is mapped to an exception with STATUS_BREAKPOINT. (The
previous instruction form does stop execution in a debugger, but
continuing might not be possible, but with udf #0xfe it is possible
to continue after stopping.)
Signed-off-by: Martin Storsjö <martin@martin.st>
This add MxCsr and FpCsr members in _JUMP_BUFFER sturcture.
Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: Liu Hao <lh_mouse@126.com>
This enables the old behavior when `-funsigned-char` is specified.
The `selectany` attribute is assumed to be supported since GCC 4.2, and
probably by Clang as well.
This test program should print 127 when `char` is signed and 255 when it
is unsigned:
#include <stdio.h>
#include <locale.h>
int main(void)
{
struct lconv* lc = localeconv();
printf("frac_digits = %d\n", lc->frac_digits);
}
Reference: https://sourceforge.net/p/mingw-w64/mailman/message/37300502/
Reference: https://gcc.gnu.org/onlinedocs/gcc-4.2.4/gcc/Variable-Attributes.html
Signed-off-by: Liu Hao <lh_mouse@126.com>
This symbol vaguely seems like it might be meant to be overridden
by the app code, but I don't see how that practically would work,
as the init routines (crtdll.c and crtexe.c) set it anyway, so
whatever default value the user code provided wouldn't have any
effect anyway.
Signed-off-by: Martin Storsjö <martin@martin.st>
Since the initial commit of mingw-w64, there's a call (in a
constructor in crt/charmax.c, pulled in via the mingw_initcharmax
variable) to __lconv_init(), which reconfigures the CRT's lconv
info to unsigned char mode - but there's no explanation for why
this is the case.
The fact that mingw-w64 initializes lconv info this way breaks
a test in llvm's libc++ (where it expects lconv's frac_digits to
be intialized to CHAR_MAX, not UCHAR_MAX). This also differs to
how MSVC environments behave, where they are initialized to
CHAR_MAX.
So unless there's a clear known reason why we'd initialize it
to unsigned char mode, revert to the same behaviour as MSVC has.
Signed-off-by: Martin Storsjö <martin@martin.st>
For unsigned print formats like %u, %o and %x, don't print a leading
plus. It wasn't printed for %+o and %+x, but %+u did print one.
Signed-off-by: Martin Storsjö <martin@martin.st>
The second implementation, which was under the 'strtold' name, was
lacking (it didn't support e.g. strings like "0x125p-1"), while the
'__mingw_strtold' one seemed correct and complete.
Signed-off-by: Martin Storsjö <martin@martin.st>
There's no need to keep two vaguely differing versions of the same
functions; out of the two, wcstold seems to be more correct.
Signed-off-by: Martin Storsjö <martin@martin.st>
The long double type in the UCRT doesn't match the one in mingw
on x86, thus make sure we don't accidentally link to them (if
the user e.g. specifies the CRT import library before libmingwex.a).
Signed-off-by: Martin Storsjö <martin@martin.st>
Before this patch, wctype.h would make iswblank always available on C++,
but ctype.h and wchar.h would not. Since they share the same definition guard
macro, one could end up not getting iswblank in C++ when including
wctype.h after ctype.h / wchar.h .
This fixes this inconsistency by making it always available when
including those headers as well.
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Signed-off-by: Liu Hao <lh_mouse@126.com>
This is similar to faa8333104 but for
the __mingw_wcstod function which is implemented around __mingw_wcstold.
Signed-off-by: Martin Storsjö <martin@martin.st>
In this case, strtod will have set errno for cases that were out of
range for doubles. For doubles that were in range, but that are out
of ranges for float, set errno before returning.
Signed-off-by: Martin Storsjö <martin@martin.st>
Defining it prevents other definitions such as `LOGFONT{A,W}` and causes
errors:
$ echo '#include <shobjidl.h>' | gcc -xc -c -DNOGDI -
In file included from <stdin>:1:
C:/msys32/mingw32/i686-w64-mingw32/include/shobjidl.h:7170:15: error:
unknown type name 'LOGFONTW'
7170 | const LOGFONTW *plf);
| ^~~~~~~~
C:/msys32/mingw32/i686-w64-mingw32/include/shobjidl.h:7324:15: error:
unknown type name 'LOGFONTW'
7324 | const LOGFONTW *plf,
| ^~~~~~~~
C:/msys32/mingw32/i686-w64-mingw32/include/shobjidl.h:7329:9: error:
unknown type name 'LOGFONTW'; did you mean 'LPFONT'?
7329 | LOGFONTW *plf);
| ^~~~~~~~
| LPFONT
Reference: https://sourceforge.net/p/mingw-w64/mailman/message/37288840/
Reported-by: Orgad Shaneh <orgads@gmail.com>
Signed-off-by: Liu Hao <lh_mouse@126.com>
GCC has `__cpuid` as a macro. GCC 11 has `__cpuidex` as a static inline
function taking the same arguments, but without any indicative macros.
Reference: 23855a1766/gcc/config/i386/cpuid.h (L333)
Signed-off-by: Liu Hao <lh_mouse@126.com>
This is the counterpart to srv.h, used to create extended stored
procedures for MSSQL.
Signed-off-by: Mark Harmstone <mark@harmstone.com>
Signed-off-by: Liu Hao <lh_mouse@126.com>
The declaration of at_quick_exit() was added in
7dda261ef0. However it is not exported
from any DLL, so we have to implement it ourselves.
This uses _crt_at_quick_exit to register functions to call if called
from an EXE, but does nothing if called from a DLL. In a DLL, we can't
unregister the callbacks if the DLL gets unloaded. This also matches
actual observed behaviour when using at_quick_exit from a DLL
when built with MSVC with the -MD option.
Signed-off-by: Martin Storsjö <martin@martin.st>
Some projects have `#define snprintf _snprintf`, which causes errors for
UCRT. This patch moves those macros so they have effects on both MSVCRT
and UCRT.
Signed-off-by: Liu Hao <lh_mouse@126.com>