msvcp120: Fix tr2::sys::__Statvfs header for gcc.

__cdecl calling convention is not compatible between Visual C++ and GCC
when return is made in memory. In GCC callee pops the hidden argument
while in Visual C++ it's done by caller.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2015-10-29 17:58:12 +01:00 committed by Alexandre Julliard
parent 17ac5ba7f9
commit d9f8bd9505
5 changed files with 32 additions and 32 deletions

View File

@ -1761,10 +1761,10 @@
@ cdecl -arch=win64 ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PEBDAEAH@Z(str ptr) tr2_sys__Stat
@ stub -arch=win32 ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PB_WAAH@Z
@ stub -arch=win64 ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PEB_WAEAH@Z
@ cdecl -arch=win32 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PBD@Z(str) tr2_sys__Statvfs
@ cdecl -arch=win64 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEBD@Z(str) tr2_sys__Statvfs
@ cdecl -arch=win32 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PB_W@Z(wstr) tr2_sys__Statvfs_wchar
@ cdecl -arch=win64 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEB_W@Z(wstr) tr2_sys__Statvfs_wchar
@ cdecl -arch=win32 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PBD@Z(ptr str) tr2_sys__Statvfs
@ cdecl -arch=win64 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEBD@Z(ptr str) tr2_sys__Statvfs
@ cdecl -arch=win32 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PB_W@Z(ptr wstr) tr2_sys__Statvfs_wchar
@ cdecl -arch=win64 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEB_W@Z(ptr wstr) tr2_sys__Statvfs_wchar
@ cdecl -arch=arm ?_Swap_all@_Container_base0@std@@QAAXAAU12@@Z(ptr ptr) Container_base0_Swap_all
@ thiscall -arch=i386 ?_Swap_all@_Container_base0@std@@QAEXAAU12@@Z(ptr ptr) Container_base0_Swap_all
@ cdecl -arch=win64 ?_Swap_all@_Container_base0@std@@QEAAXAEAU12@@Z(ptr ptr) Container_base0_Swap_all

View File

@ -1722,10 +1722,10 @@
@ cdecl -arch=win64 ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PEBDAEAH@Z(str ptr) tr2_sys__Stat
@ stub -arch=win32 ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PB_WAAH@Z
@ stub -arch=win64 ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PEB_WAEAH@Z
@ cdecl -arch=win32 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PBD@Z(str) tr2_sys__Statvfs
@ cdecl -arch=win64 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEBD@Z(str) tr2_sys__Statvfs
@ cdecl -arch=win32 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PB_W@Z(wstr) tr2_sys__Statvfs_wchar
@ cdecl -arch=win64 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEB_W@Z(wstr) tr2_sys__Statvfs_wchar
@ cdecl -arch=win32 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PBD@Z(ptr str) tr2_sys__Statvfs
@ cdecl -arch=win64 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEBD@Z(ptr str) tr2_sys__Statvfs
@ cdecl -arch=win32 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PB_W@Z(ptr wstr) tr2_sys__Statvfs_wchar
@ cdecl -arch=win64 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEB_W@Z(ptr wstr) tr2_sys__Statvfs_wchar
@ cdecl -arch=arm ?_Swap_all@_Container_base0@std@@QAAXAAU12@@Z(ptr ptr) Container_base0_Swap_all
@ thiscall -arch=i386 ?_Swap_all@_Container_base0@std@@QAEXAAU12@@Z(ptr ptr) Container_base0_Swap_all
@ cdecl -arch=win64 ?_Swap_all@_Container_base0@std@@QEAAXAEAU12@@Z(ptr ptr) Container_base0_Swap_all

View File

@ -123,8 +123,8 @@ static int (__cdecl *p_tr2_sys__Copy_file)(char const*, char const*, MSVCP_bool)
static int (__cdecl *p_tr2_sys__Copy_file_wchar)(WCHAR const*, WCHAR const*, MSVCP_bool);
static int (__cdecl *p_tr2_sys__Rename)(char const*, char const*);
static int (__cdecl *p_tr2_sys__Rename_wchar)(WCHAR const*, WCHAR const*);
static struct space_info (__cdecl *p_tr2_sys__Statvfs)(char const*);
static struct space_info (__cdecl *p_tr2_sys__Statvfs_wchar)(WCHAR const*);
static struct space_info* (__cdecl *p_tr2_sys__Statvfs)(struct space_info*, char const*);
static struct space_info* (__cdecl *p_tr2_sys__Statvfs_wchar)(struct space_info*, WCHAR const*);
static enum file_type (__cdecl *p_tr2_sys__Stat)(char const*, int *);
static enum file_type (__cdecl *p_tr2_sys__Lstat)(char const*, int *);
static __int64 (__cdecl *p_tr2_sys__Last_write_time)(char const*);
@ -984,15 +984,15 @@ static void test_tr2_sys__Statvfs(void)
memset(current_path_wchar, 0, MAX_PATH);
p_tr2_sys__Current_get_wchar(current_path_wchar);
info = p_tr2_sys__Statvfs(current_path);
p_tr2_sys__Statvfs(&info, current_path);
ok(info.capacity >= info.free, "test_tr2_sys__Statvfs(): info.capacity < info.free\n");
ok(info.free >= info.available, "test_tr2_sys__Statvfs(): info.free < info.available\n");
info = p_tr2_sys__Statvfs_wchar(current_path_wchar);
p_tr2_sys__Statvfs_wchar(&info, current_path_wchar);
ok(info.capacity >= info.free, "tr2_sys__Statvfs_wchar(): info.capacity < info.free\n");
ok(info.free >= info.available, "tr2_sys__Statvfs_wchar(): info.free < info.available\n");
info = p_tr2_sys__Statvfs(NULL);
p_tr2_sys__Statvfs(&info, NULL);
ok(info.available == 0, "test_tr2_sys__Statvfs(): info.available expect: %d, got %s\n",
0, debugstr_longlong(info.available));
ok(info.capacity == 0, "test_tr2_sys__Statvfs(): info.capacity expect: %d, got %s\n",
@ -1000,7 +1000,7 @@ static void test_tr2_sys__Statvfs(void)
ok(info.free == 0, "test_tr2_sys__Statvfs(): info.free expect: %d, got %s\n",
0, debugstr_longlong(info.free));
info = p_tr2_sys__Statvfs("not_exist");
p_tr2_sys__Statvfs(&info, "not_exist");
ok(info.available == 0, "test_tr2_sys__Statvfs(): info.available expect: %d, got %s\n",
0, debugstr_longlong(info.available));
ok(info.capacity == 0, "test_tr2_sys__Statvfs(): info.capacity expect: %d, got %s\n",

View File

@ -1722,10 +1722,10 @@
@ cdecl -arch=win64 ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PEBDAEAH@Z(str ptr) msvcp120.?_Stat@sys@tr2@std@@YA?AW4file_type@123@PEBDAEAH@Z
@ stub -arch=win32 ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PB_WAAH@Z
@ stub -arch=win64 ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PEB_WAEAH@Z
@ cdecl -arch=win32 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PBD@Z(str) msvcp120.?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PBD@Z
@ cdecl -arch=win64 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEBD@Z(str) msvcp120.?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEBD@Z
@ cdecl -arch=win32 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PB_W@Z(wstr) msvcp120.?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PB_W@Z
@ cdecl -arch=win64 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEB_W@Z(wstr) msvcp120.?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEB_W@Z
@ cdecl -arch=win32 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PBD@Z(ptr str) msvcp120.?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PBD@Z
@ cdecl -arch=win64 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEBD@Z(ptr str) msvcp120.?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEBD@Z
@ cdecl -arch=win32 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PB_W@Z(ptr wstr) msvcp120.?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PB_W@Z
@ cdecl -arch=win64 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEB_W@Z(ptr wstr) msvcp120.?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEB_W@Z
@ cdecl -arch=arm ?_Swap_all@_Container_base0@std@@QAAXAAU12@@Z(ptr ptr) msvcp120.?_Swap_all@_Container_base0@std@@QAAXAAU12@@Z
@ thiscall -arch=i386 ?_Swap_all@_Container_base0@std@@QAEXAAU12@@Z(ptr ptr) msvcp120.?_Swap_all@_Container_base0@std@@QAEXAAU12@@Z
@ cdecl -arch=win64 ?_Swap_all@_Container_base0@std@@QEAAXAEAU12@@Z(ptr ptr) msvcp120.?_Swap_all@_Container_base0@std@@QEAAXAEAU12@@Z

View File

@ -14329,20 +14329,20 @@ int __cdecl tr2_sys__Rename(char const* old_path, char const* new_path)
/* ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PBD@Z */
/* ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEBD@Z */
struct space_info __cdecl tr2_sys__Statvfs(const char* path)
struct space_info* __cdecl tr2_sys__Statvfs(struct space_info *ret, const char* path)
{
ULARGE_INTEGER available, total, free;
struct space_info info;
TRACE("(%s)\n", debugstr_a(path));
if(!path || !GetDiskFreeSpaceExA(path, &available, &total, &free)) {
info.capacity = info.free = info.available = 0;
ret->capacity = ret->free = ret->available = 0;
}else {
info.capacity = total.QuadPart;
info.free = free.QuadPart;
info.available = available.QuadPart;
ret->capacity = total.QuadPart;
ret->free = free.QuadPart;
ret->available = available.QuadPart;
}
return info;
return ret;
}
/* ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PBDAAH@Z */
@ -14919,20 +14919,20 @@ int __cdecl tr2_sys__Rename_wchar(WCHAR const* old_path, WCHAR const* new_path)
/* ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PB_W@Z */
/* ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEB_W@Z */
struct space_info __cdecl tr2_sys__Statvfs_wchar(const WCHAR* path)
struct space_info* __cdecl tr2_sys__Statvfs_wchar(struct space_info *ret, const WCHAR* path)
{
ULARGE_INTEGER available, total, free;
struct space_info info;
TRACE("(%s)\n", debugstr_w(path));
if(!path || !GetDiskFreeSpaceExW(path, &available, &total, &free)) {
info.capacity = info.free = info.available = 0;
ret->capacity = ret->free = ret->available = 0;
}else {
info.capacity = total.QuadPart;
info.free = free.QuadPart;
info.available = available.QuadPart;
ret->capacity = total.QuadPart;
ret->free = free.QuadPart;
ret->available = available.QuadPart;
}
return info;
return ret;
}
/* ??1_Winit@std@@QAE@XZ */