From 2d471db92f0df5d0682369651c0cbb94312cc988 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Tue, 1 Dec 2020 13:51:47 +0100 Subject: [PATCH] msvcrt: Use __utimbuf{32,64} from public header. Signed-off-by: Piotr Caban Signed-off-by: Alexandre Julliard --- dlls/crtdll/crtdll.spec | 6 ++-- dlls/msvcr70/msvcr70.spec | 9 ++++-- dlls/msvcr71/msvcr71.spec | 9 ++++-- dlls/msvcrt/file.c | 64 ++++++--------------------------------- dlls/msvcrt/msvcrt.h | 12 -------- dlls/msvcrt/msvcrt.spec | 9 ++++-- dlls/msvcrtd/msvcrtd.spec | 9 ++++-- 7 files changed, 38 insertions(+), 80 deletions(-) diff --git a/dlls/crtdll/crtdll.spec b/dlls/crtdll/crtdll.spec index b1e665bf283..478783fda6a 100644 --- a/dlls/crtdll/crtdll.spec +++ b/dlls/crtdll/crtdll.spec @@ -117,7 +117,8 @@ @ cdecl _ftime(ptr) MSVCRT__ftime @ cdecl -arch=i386 -ret64 _ftol() MSVCRT__ftol @ cdecl _fullpath(ptr str long) MSVCRT__fullpath -@ cdecl _futime(long ptr) +@ cdecl -arch=win32 _futime(long ptr) _futime32 +@ cdecl -arch=win64 _futime(long ptr) _futime64 @ cdecl _gcvt(double long str) MSVCRT__gcvt @ cdecl _get_osfhandle(long) MSVCRT__get_osfhandle @ cdecl _getch() @@ -318,7 +319,8 @@ @ cdecl _ungetch(long) @ cdecl _unlink(str) MSVCRT__unlink @ cdecl _unloaddll(long) -@ cdecl _utime(str ptr) +@ cdecl -arch=win32 _utime(str ptr) _utime32 +@ cdecl -arch=win64 _utime(str ptr) _utime64 @ cdecl _vsnprintf(ptr long str ptr) @ cdecl _vsnwprintf(ptr long wstr ptr) MSVCRT_vsnwprintf @ cdecl _wcsdup(wstr) MSVCRT__wcsdup diff --git a/dlls/msvcr70/msvcr70.spec b/dlls/msvcr70/msvcr70.spec index 93ecc56e281..35406607883 100644 --- a/dlls/msvcr70/msvcr70.spec +++ b/dlls/msvcr70/msvcr70.spec @@ -325,7 +325,8 @@ @ cdecl _ftime64(ptr) MSVCRT__ftime64 @ cdecl -arch=i386 -ret64 _ftol() MSVCRT__ftol @ cdecl _fullpath(ptr str long) MSVCRT__fullpath -@ cdecl _futime(long ptr) +@ cdecl -arch=win32 _futime(long ptr) _futime32 +@ cdecl -arch=win64 _futime(long ptr) _futime64 @ cdecl _futime64(long ptr) @ cdecl _gcvt(double long str) MSVCRT__gcvt @ cdecl _get_osfhandle(long) MSVCRT__get_osfhandle @@ -582,7 +583,8 @@ @ cdecl _unlink(str) MSVCRT__unlink @ cdecl _unloaddll(long) @ cdecl _unlock(long) -@ cdecl _utime(str ptr) +@ cdecl -arch=win32 _utime(str ptr) _utime32 +@ cdecl -arch=win64 _utime(str ptr) _utime64 @ cdecl _utime64(str ptr) @ cdecl _vscprintf(str ptr) MSVCRT__vscprintf @ cdecl _vscwprintf(wstr ptr) MSVCRT__vscwprintf @@ -674,7 +676,8 @@ @ cdecl -ret64 _wtoi64(wstr) MSVCRT__wtoi64 @ cdecl _wtol(wstr) MSVCRT__wtol @ cdecl _wunlink(wstr) MSVCRT__wunlink -@ cdecl _wutime(wstr ptr) +@ cdecl -arch=win32 _wutime(wstr ptr) _wutime32 +@ cdecl -arch=win64 _wutime(wstr ptr) _wutime64 @ cdecl _wutime64(wstr ptr) @ cdecl _y0(double) MSVCRT__y0 @ cdecl _y1(double) MSVCRT__y1 diff --git a/dlls/msvcr71/msvcr71.spec b/dlls/msvcr71/msvcr71.spec index 674ebb04db9..6a1bfd180b2 100644 --- a/dlls/msvcr71/msvcr71.spec +++ b/dlls/msvcr71/msvcr71.spec @@ -319,7 +319,8 @@ @ cdecl _ftime64(ptr) MSVCRT__ftime64 @ cdecl -arch=i386 -ret64 _ftol() MSVCRT__ftol @ cdecl _fullpath(ptr str long) MSVCRT__fullpath -@ cdecl _futime(long ptr) +@ cdecl -arch=win32 _futime(long ptr) _futime32 +@ cdecl -arch=win64 _futime(long ptr) _futime64 @ cdecl _futime64(long ptr) @ cdecl _gcvt(double long str) MSVCRT__gcvt @ cdecl _get_heap_handle() @@ -578,7 +579,8 @@ @ cdecl _unlink(str) MSVCRT__unlink @ cdecl _unloaddll(long) @ cdecl _unlock(long) -@ cdecl _utime(str ptr) +@ cdecl -arch=win32 _utime(str ptr) _utime32 +@ cdecl -arch=win64 _utime(str ptr) _utime64 @ cdecl _utime64(str ptr) @ cdecl _vscprintf(str ptr) MSVCRT__vscprintf @ cdecl _vscwprintf(wstr ptr) MSVCRT__vscwprintf @@ -670,7 +672,8 @@ @ cdecl -ret64 _wtoi64(wstr) MSVCRT__wtoi64 @ cdecl _wtol(wstr) MSVCRT__wtol @ cdecl _wunlink(wstr) MSVCRT__wunlink -@ cdecl _wutime(wstr ptr) +@ cdecl -arch=win32 _wutime(wstr ptr) _wutime32 +@ cdecl -arch=win64 _wutime(wstr ptr) _wutime64 @ cdecl _wutime64(wstr ptr) @ cdecl _y0(double) MSVCRT__y0 @ cdecl _y1(double) MSVCRT__y1 diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 5d54188e17f..3ab18e8ac8e 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include "windef.h" @@ -1862,7 +1863,7 @@ int CDECL MSVCRT__fstat64i32(int fd, struct MSVCRT__stat64i32* buf) /********************************************************************* * _futime64 (MSVCRT.@) */ -int CDECL _futime64(int fd, struct MSVCRT___utimbuf64 *t) +int CDECL _futime64(int fd, struct __utimbuf64 *t) { ioinfo *info = get_ioinfo(fd); FILETIME at, wt; @@ -1891,11 +1892,11 @@ int CDECL _futime64(int fd, struct MSVCRT___utimbuf64 *t) /********************************************************************* * _futime32 (MSVCRT.@) */ -int CDECL _futime32(int fd, struct MSVCRT___utimbuf32 *t) +int CDECL _futime32(int fd, struct __utimbuf32 *t) { if (t) { - struct MSVCRT___utimbuf64 t64; + struct __utimbuf64 t64; t64.actime = t->actime; t64.modtime = t->modtime; return _futime64( fd, &t64 ); @@ -1904,21 +1905,6 @@ int CDECL _futime32(int fd, struct MSVCRT___utimbuf32 *t) return _futime64( fd, NULL ); } -/********************************************************************* - * _futime (MSVCRT.@) - */ -#ifdef _WIN64 -int CDECL _futime(int fd, struct MSVCRT___utimbuf64 *t) -{ - return _futime64( fd, t ); -} -#else -int CDECL _futime(int fd, struct MSVCRT___utimbuf32 *t) -{ - return _futime32( fd, t ); -} -#endif - /********************************************************************* * _get_osfhandle (MSVCRT.@) */ @@ -3337,7 +3323,7 @@ int CDECL MSVCRT__umask(int umask) /********************************************************************* * _utime64 (MSVCRT.@) */ -int CDECL _utime64(const char* path, struct MSVCRT___utimbuf64 *t) +int CDECL _utime64(const char* path, struct __utimbuf64 *t) { int fd = MSVCRT__open(path, MSVCRT__O_WRONLY | MSVCRT__O_BINARY); @@ -3353,11 +3339,11 @@ int CDECL _utime64(const char* path, struct MSVCRT___utimbuf64 *t) /********************************************************************* * _utime32 (MSVCRT.@) */ -int CDECL _utime32(const char* path, struct MSVCRT___utimbuf32 *t) +int CDECL _utime32(const char* path, struct __utimbuf32 *t) { if (t) { - struct MSVCRT___utimbuf64 t64; + struct __utimbuf64 t64; t64.actime = t->actime; t64.modtime = t->modtime; return _utime64( path, &t64 ); @@ -3366,25 +3352,10 @@ int CDECL _utime32(const char* path, struct MSVCRT___utimbuf32 *t) return _utime64( path, NULL ); } -/********************************************************************* - * _utime (MSVCRT.@) - */ -#ifdef _WIN64 -int CDECL _utime(const char* path, struct MSVCRT___utimbuf64 *t) -{ - return _utime64( path, t ); -} -#else -int CDECL _utime(const char* path, struct MSVCRT___utimbuf32 *t) -{ - return _utime32( path, t ); -} -#endif - /********************************************************************* * _wutime64 (MSVCRT.@) */ -int CDECL _wutime64(const wchar_t* path, struct MSVCRT___utimbuf64 *t) +int CDECL _wutime64(const wchar_t* path, struct __utimbuf64 *t) { int fd = MSVCRT__wopen(path, MSVCRT__O_WRONLY | MSVCRT__O_BINARY); @@ -3400,11 +3371,11 @@ int CDECL _wutime64(const wchar_t* path, struct MSVCRT___utimbuf64 *t) /********************************************************************* * _wutime32 (MSVCRT.@) */ -int CDECL _wutime32(const wchar_t* path, struct MSVCRT___utimbuf32 *t) +int CDECL _wutime32(const wchar_t* path, struct __utimbuf32 *t) { if (t) { - struct MSVCRT___utimbuf64 t64; + struct __utimbuf64 t64; t64.actime = t->actime; t64.modtime = t->modtime; return _wutime64( path, &t64 ); @@ -3413,21 +3384,6 @@ int CDECL _wutime32(const wchar_t* path, struct MSVCRT___utimbuf32 *t) return _wutime64( path, NULL ); } -/********************************************************************* - * _wutime (MSVCRT.@) - */ -#ifdef _WIN64 -int CDECL _wutime(const wchar_t* path, struct MSVCRT___utimbuf64 *t) -{ - return _wutime64( path, t ); -} -#else -int CDECL _wutime(const wchar_t* path, struct MSVCRT___utimbuf32 *t) -{ - return _wutime32( path, t ); -} -#endif - /********************************************************************* * _write (MSVCRT.@) */ diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index a786c0f351e..d97c1b70dc8 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -451,18 +451,6 @@ struct MSVCRT__wfinddata64_t { wchar_t name[260]; }; -struct MSVCRT___utimbuf32 -{ - __time32_t actime; - __time32_t modtime; -}; - -struct MSVCRT___utimbuf64 -{ - __time64_t actime; - __time64_t modtime; -}; - struct MSVCRT__stat32 { _dev_t st_dev; _ino_t st_ino; diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 0eb83ab6c81..70266a3fd3b 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -488,7 +488,8 @@ # stub _ftol2_sse_excpt @ cdecl _fullpath(ptr str long) MSVCRT__fullpath # stub _fullpath_dbg(ptr str long long str long) -@ cdecl _futime(long ptr) +@ cdecl -arch=win32 _futime(long ptr) _futime32 +@ cdecl -arch=win64 _futime(long ptr) _futime64 @ cdecl _futime32(long ptr) @ cdecl _futime64(long ptr) @ varargs _fwprintf_l(ptr wstr ptr) MSVCRT__fwprintf_l @@ -1055,7 +1056,8 @@ # stub _vprintf_p(str ptr) # stub _vprintf_p_l(str ptr ptr) # stub _vprintf_s_l(str ptr ptr) -@ cdecl _utime(str ptr) +@ cdecl -arch=win32 _utime(str ptr) _utime32 +@ cdecl -arch=win64 _utime(str ptr) _utime64 @ cdecl _vscprintf(str ptr) MSVCRT__vscprintf @ cdecl _vscprintf_l(str ptr ptr) MSVCRT__vscprintf_l @ cdecl _vscprintf_p_l(str ptr ptr) MSVCRT__vscprintf_p_l @@ -1234,7 +1236,8 @@ @ cdecl _wtol(wstr) MSVCRT__wtol @ cdecl _wtol_l(wstr ptr) MSVCRT__wtol_l @ cdecl _wunlink(wstr) MSVCRT__wunlink -@ cdecl _wutime(wstr ptr) +@ cdecl -arch=win32 _wutime(wstr ptr) _wutime32 +@ cdecl -arch=win64 _wutime(wstr ptr) _wutime64 @ cdecl _wutime32(wstr ptr) @ cdecl _wutime64(wstr ptr) @ cdecl _y0(double) MSVCRT__y0 diff --git a/dlls/msvcrtd/msvcrtd.spec b/dlls/msvcrtd/msvcrtd.spec index cbceb6f10b6..eef7755ed79 100644 --- a/dlls/msvcrtd/msvcrtd.spec +++ b/dlls/msvcrtd/msvcrtd.spec @@ -305,7 +305,8 @@ @ cdecl _ftime(ptr) MSVCRT__ftime @ cdecl -arch=i386 -ret64 _ftol() MSVCRT__ftol @ cdecl _fullpath(ptr str long) MSVCRT__fullpath -@ cdecl _futime(long ptr) +@ cdecl -arch=win32 _futime(long ptr) _futime32 +@ cdecl -arch=win64 _futime(long ptr) _futime64 @ cdecl _gcvt(double long str) MSVCRT__gcvt @ cdecl _get_osfhandle(long) MSVCRT__get_osfhandle @ cdecl _get_sbh_threshold() @@ -547,7 +548,8 @@ @ cdecl _unlink(str) MSVCRT__unlink @ cdecl _unloaddll(long) @ cdecl _unlock(long) -@ cdecl _utime(str ptr) +@ cdecl -arch=win32 _utime(str ptr) _utime32 +@ cdecl -arch=win64 _utime(str ptr) _utime64 @ cdecl _vsnprintf(ptr long str ptr) @ cdecl _vsnwprintf(ptr long wstr ptr) MSVCRT_vsnwprintf @ cdecl _waccess(wstr long) MSVCRT__waccess @@ -627,7 +629,8 @@ @ cdecl -ret64 _wtoi64(wstr) MSVCRT__wtoi64 @ cdecl _wtol(wstr) MSVCRT__wtol @ cdecl _wunlink(wstr) MSVCRT__wunlink -@ cdecl _wutime(wstr ptr) +@ cdecl -arch=win32 _wutime(wstr ptr) _wutime32 +@ cdecl -arch=win64 _wutime(wstr ptr) _wutime64 @ cdecl _y0(double) MSVCRT__y0 @ cdecl _y1(double) MSVCRT__y1 @ cdecl _yn(long double) MSVCRT__yn