ARM32 and ARM64 always contain all Vista symbols. So use them directly
instead of the mingw-w64 emulation.
The only Vista+ symbol which stay disabled in the def file is vsnprintf.
It is because this Vista+ vsnprintf symbol is not C99 compatible and is
just an alias to _vsnprintf symbol which does not fill nul term byte.
Signed-off-by: Martin Storsjö <martin@martin.st>
Include all ARM64 C++ mangled symbols. Add _local_unwind symbol which is
present also in ARM64 version. And remove _setjmp, setjmp and __jump_unwind
symbols which are not present in any ARM64 version.
As a reference were checked msvcrt.dll versions 7.0.17083.1000 and
7.0.19041.546 and all have same set of symbols.
Signed-off-by: Martin Storsjö <martin@martin.st>
Usage of F_I386() macro per symbol allows to easily identify via "git grep"
if the particular symbol is available for specific architecture or not.
"#ifdef DEF_I386" prevents easy usage of "git grep".
So change remaining "#ifdef DEF_I386" blocks by per-symbol F_I386() macros.
Signed-off-by: Martin Storsjö <martin@martin.st>
Functions _fseeki64() and _ftelli64() are natively available since
msvcr80.dll.
mingw-w64 already provides emulation of _fseeki64() and _ftelli64()
functions for msvcrt.dll import library via _filelengthi64(), fgetpos(),
fsetpos() and fflush() functions.
So include this emulation into all pre-msvcr80 CRT import libraries as all
of import libraries for them already contains all ABI-compatible dependent
functions.
Signed-off-by: Martin Storsjö <martin@martin.st>
Function _filelengthi64() is available since msvcrt40.dll.
For previous CRT versions, which have only 32-bit file offsets, define it
as wrapper around 32-bit _filelength() function.
Signed-off-by: Martin Storsjö <martin@martin.st>
Functions fgetpos64() and fsetpos64() are just aliases for functions
fgetpos() and fsetpos() as they are already using 64-bit fpos_t type.
Most aliased functions are defined in crt-aliases.def.in file. Do same also
for fgetpos64() and fsetpos64() functions by moving them from individual C
files stdio/fgetpos64.c and stdio/fsetpos64.c.
Libraries which do not have real fgetpos() and fsetpos() have aliases
defined in the same file were are defined compatibility wrappers.
Signed-off-by: Martin Storsjö <martin@martin.st>
Functions fgetpos() and fsetpos() in these libraries have different ABI
than in all later versions starting with msvcrt40.
Their second argument is pointer to 32-bit signed value, which is not
compatible with the fpos_t type (64-bit), used by all later versions.
So rename these functions in these import libraries to names with suffix 32
and provides mingw-w64 fpos_t (64-bit) wrappers around them for ABI
compatibility.
This change fixes ABI compatibility for those older DLL libraries.
Signed-off-by: Martin Storsjö <martin@martin.st>
Functions _get_errno() and _set_errno() are natively available since
msvcr80.dll and also since Windows Vista version of msvcrt.dll.
Import libraries for crtdll, msvcrt10-40 and msvcrt.dll already contains
emulation of these functions. Include this emulation also for msvcr70 and
msvcr71, so these functions would be available in all CRT import libraries.
Signed-off-by: Martin Storsjö <martin@martin.st>
Function _wassert() is natively available since msvcr80.dll and also since
Windows Vista version of msvcrt.dll.
Import library for i386 version of msvcrt.dll already contains emulation of
this function.
Include this emulation into x64 version of msvcrt.dll and also into crtdll,
msvcrt10-40 and msvcr70-71 libraries, so function _wassert() would be
available in all CRT import libraries.
For import libraries other than msvcrt.dll, improve emulation code, so it
does not try to resolve that function from DLL as in other versions it is
never available.
Signed-off-by: Martin Storsjö <martin@martin.st>
Function _set_purecall_handler() is natively available since msvcr70.dll.
For all previous CRT versions include mingw-w64 emulation.
Emulation is already included for msvcrt-os.
Signed-off-by: Martin Storsjö <martin@martin.st>
These functions are natively available since msvcr80.dll and also since
Vista version of msvcrt.dll. They are available also in ARM versions.
For all older CRT versions include mingw-w64 emulation.
Emulation in misc/output_format.c is slightly updated to optimize code for
non-msvcrt.dll version which do not provide these functions.
Signed-off-by: Martin Storsjö <martin@martin.st>
Function _configthreadlocale() is natively available since msvcr80.dll.
For all previous CRT versions include mingw-w64 emulation.
Emulation is already included for msvcrt-os.
Signed-off-by: Martin Storsjö <martin@martin.st>
msvcr120 and UCRT provides native nextafter symbol. So do not define
duplicate symbol nextafter via crt-aliases.def.in file for these import
libraries.
Signed-off-by: Martin Storsjö <martin@martin.st>
Long double type for msvc is 64-bit but for gcc it is 80-bit.
So these long double functions are not compatible with gcc.
Comment them in all msvcr120 def files for x86 platform.
Signed-off-by: Martin Storsjö <martin@martin.st>
All msvcr120 DLL libraries provides C99 nextafter() function. i386
msvcr120d.def.in already contains it. In other def files it is missing.
Signed-off-by: Martin Storsjö <martin@martin.st>
x64 version has this symbol with two leading underlines.
i386 version has this symbol with just one leading underline.
Same applies for other msvcrt libraries.
Signed-off-by: Martin Storsjö <martin@martin.st>
Some cdecl functions have incorrect stdcall suffix @0 probably due to
false-positive detection by gendef. Remove incorrect suffix.
Signed-off-by: Martin Storsjö <martin@martin.st>
Some cdecl functions have incorrect stdcall suffix @0 probably due to
false-positive detection by gendef. Remove incorrect suffix.
Signed-off-by: Martin Storsjö <martin@martin.st>
Function _adj_fdiv_r in msvcr90d.dll returns like in other msvcrt
libraries. Just gendef is not able to recognize it.
Signed-off-by: Martin Storsjö <martin@martin.st>
These seem to have been missed in
38fa547c16.
This allows using the UCRT functions nexttoward, nexttowardl and
nextafterl on ARM/AArch64. (math/nextafterl.c provides both
the function nextafterl, and nexttowardl.)
On x86, all these functions take one long double parameter, so the
UCRT version can't be used (as the size of long doubles differ
between mingw mode and MSVC mode on x86).
Signed-off-by: Martin Storsjö <martin@martin.st>