crt: Provide emulation of _fstat64, _stat64 and _wstat64 functions
These functions are available since msvcr70.dll. For older msvcrt versions
provide emulation via _fstat32(), _stat32() and _wstat32() functions. These
functions in all pre-msvcr100 CRT libraries provides only truncated 32-bit
file size and invalid value -1 as timestamp.
The real 64-bit non-truncated file size and valid timestamp information is
retrieved via the WinAPI calls.
For _stat64() and _wstat64() use WinAPI FindFirstFile() call. And for
_fstat64() use WinAPI GetFileInformationByHandle() call. Same thing is
doing msvcrt DLL library for other stat functions. Note that both WinAPI
functions are available in all Windows version (since the Windows NT 3.1
and the Windows 95).
Functions _fstat64() and _stat64() are already used by mingw-w64 crt, so
ensure that they are present in every CRT import library.
Signed-off-by: Martin Storsjö <martin@martin.st>
6 files changed