diff --git a/Source/Windows/Common/CRT/IO.cpp b/Source/Windows/Common/CRT/IO.cpp index db02645e34..d3ec9eb99d 100644 --- a/Source/Windows/Common/CRT/IO.cpp +++ b/Source/Windows/Common/CRT/IO.cpp @@ -278,31 +278,23 @@ int fclose(FILE* File) { return 0; } -int fseeko64(FILE* File, _off64_t Offset, int Origin) { +DLLEXPORT_FUNC(int, _fseeki64, (FILE* File, _off64_t Offset, int Origin)) { SetFilePointerEx(File->Handle, LARGE_INTEGER {.QuadPart = Offset}, nullptr, OriginToMoveMethod(Origin)); return 0; } -int fseeko(FILE* File, _off_t Offset, int Origin) { - return fseeko64(File, Offset, Origin); -} - int fseek(FILE* File, long Offset, int Origin) { - return fseeko64(File, Offset, Origin); + return _fseeki64(File, Offset, Origin); } -_off64_t ftello64(FILE* File) { +DLLEXPORT_FUNC(_off64_t, _ftelli64, (FILE* File)) { LARGE_INTEGER Res; SetFilePointerEx(File->Handle, LARGE_INTEGER {}, &Res, FILE_CURRENT); return Res.QuadPart; } -_off_t ftello(FILE* File) { - return static_cast<_off_t>(ftello64(File)); -} - long ftell(FILE* File) { - return static_cast(ftello64(File)); + return static_cast(_ftelli64(File)); } size_t fread(void* __restrict__ DstBuf, size_t ElementSize, size_t Count, FILE* __restrict__ File) { @@ -328,7 +320,11 @@ int fflush(FILE* _File) { UNIMPLEMENTED(); } -int __mingw_vfprintf(FILE* __restrict__, const char* __restrict__, va_list) { +int fprintf(FILE* __restrict__, const char* __restrict__, ...) { + UNIMPLEMENTED(); +} + +int vfprintf(FILE* __restrict__, const char* __restrict__, va_list) { UNIMPLEMENTED(); } @@ -348,6 +344,10 @@ int fputc(int _Ch, FILE* _File) { UNIMPLEMENTED(); } +int fputs(const char * __restrict__ _Str,FILE * __restrict__ _File) { + UNIMPLEMENTED(); +} + int getc(FILE* _File) { UNIMPLEMENTED(); } diff --git a/Source/Windows/Common/CRT/String.cpp b/Source/Windows/Common/CRT/String.cpp index 7f04a1e132..0da6bc322a 100644 --- a/Source/Windows/Common/CRT/String.cpp +++ b/Source/Windows/Common/CRT/String.cpp @@ -32,11 +32,11 @@ char* strdup(const char* Src) { return _strdup(Src); } -float __mingw_strtof(const char* __restrict__, char** __restrict__) { +float strtof(const char* __restrict__, char** __restrict__) { UNIMPLEMENTED(); } -double __mingw_strtod(const char* __restrict__, char** __restrict__) { +double strtod(const char* __restrict__, char** __restrict__) { UNIMPLEMENTED(); } @@ -60,7 +60,7 @@ long double strtold(const char* __restrict__, char** __restrict__) { UNIMPLEMENTED(); } -double __mingw_wcstod(const wchar_t* __restrict__ _Str, wchar_t** __restrict__ _EndPtr) { +double wcstod(const wchar_t* __restrict__ _Str, wchar_t** __restrict__ _EndPtr) { UNIMPLEMENTED(); } @@ -68,7 +68,7 @@ long double wcstold(const wchar_t* __restrict__, wchar_t** __restrict__) { UNIMPLEMENTED(); } -float __mingw_wcstof(const wchar_t* __restrict__ nptr, wchar_t** __restrict__ endptr) { +float wcstof(const wchar_t* __restrict__ nptr, wchar_t** __restrict__ endptr) { UNIMPLEMENTED(); } @@ -80,10 +80,14 @@ DLLEXPORT_FUNC(unsigned __int64, _strtoui64_l, (const char* _String, char** _End UNIMPLEMENTED(); } -int __mingw_vsscanf(const char* __restrict__ _Str, const char* __restrict__ Format, va_list argp) { +int __stdio_common_vsscanf(unsigned __int64 options, const char *input, size_t length, const char *format, _locale_t locale, va_list valist) { UNIMPLEMENTED(); } +int __stdio_common_vswprintf(unsigned __int64 options, wchar_t *str, size_t len, const wchar_t *format, _locale_t locale, va_list valist) { + return _vsnwprintf(str, len, format, valist); +} + int __mingw_vsnwprintf(wchar_t* __restrict__ Dest, size_t Count, const wchar_t* __restrict__ Format, va_list Args) { int ret = _vsnwprintf(Dest, Count, Format, Args); return ret; @@ -94,11 +98,11 @@ int __mingw_vsprintf(char* __restrict__ Dest, const char* __restrict__ Format, v return ret; } -size_t strftime(char* __restrict__ _Buf, size_t _SizeInBytes, const char* __restrict__ _Format, const struct tm* __restrict__ _Tm) { +DLLEXPORT_FUNC(size_t, _strftime_l, (char * __restrict__ Buf,size_t Max_size,const char * __restrict__ Format,const struct tm * __restrict__ Tm,_locale_t Locale)) { UNIMPLEMENTED(); } -int __mingw_vsnprintf(char* __restrict__ Dest, size_t Count, const char* __restrict__ Format, va_list Args) { +int vsnprintf(char* __restrict__ Dest, size_t Count, const char* __restrict__ Format, va_list Args) { int ret = _vsnprintf(Dest, Count, Format, Args); if (ret == -1) { Dest[Count - 1] = '\0'; @@ -107,6 +111,15 @@ int __mingw_vsnprintf(char* __restrict__ Dest, size_t Count, const char* __restr return ret; } +int snprintf(char *stream, size_t n, const char *format, ...) +{ + __builtin_va_list args; + __builtin_va_start(args, format); + int ret = vsnprintf(stream, n, format, args); + __builtin_va_end(args); + return ret; +} + char* setlocale(int _Category, const char* _Locale) { return Locale; } @@ -166,10 +179,6 @@ DLLEXPORT_FUNC(errno_t, strerror_s, (char* _Buf, size_t _SizeInBytes, int _ErrNu UNIMPLEMENTED(); } -DLLEXPORT_FUNC(int, _sscanf_l, (const char* buffer, const char* format, _locale_t locale, ...)) { - UNIMPLEMENTED(); -} - DLLEXPORT_FUNC(int, _isctype, (int _C, int _Type)) { UNIMPLEMENTED(); }