diff --git a/dlls/kernel32/string.c b/dlls/kernel32/string.c index ecac281f133..1f606fd7f6c 100644 --- a/dlls/kernel32/string.c +++ b/dlls/kernel32/string.c @@ -36,7 +36,7 @@ static INT (WINAPI *pLoadStringA)(HINSTANCE, UINT, LPSTR, INT); -static INT (WINAPI *pwvsprintfA)(LPSTR, LPCSTR, va_list); +static INT (WINAPI *pwvsprintfA)(LPSTR, LPCSTR, __ms_va_list); /*********************************************************************** @@ -118,7 +118,7 @@ INT WINAPI k32LoadStringA(HINSTANCE instance, UINT resource_id, /*********************************************************************** * k32wvsprintfA (KERNEL32.16) */ -INT WINAPI k32wvsprintfA(LPSTR buffer, LPCSTR spec, va_list args) +INT WINAPI k32wvsprintfA(LPSTR buffer, LPCSTR spec, __ms_va_list args) { if(!pwvsprintfA) pwvsprintfA = user32_proc_address("wvsprintfA"); return (*pwvsprintfA)(buffer, spec, args); @@ -130,12 +130,12 @@ INT WINAPI k32wvsprintfA(LPSTR buffer, LPCSTR spec, va_list args) */ INT WINAPIV k32wsprintfA(LPSTR buffer, LPCSTR spec, ...) { - va_list args; + __ms_va_list args; INT res; - va_start(args, spec); + __ms_va_start(args, spec); res = k32wvsprintfA(buffer, spec, args); - va_end(args); + __ms_va_end(args); return res; } diff --git a/dlls/user32/wsprintf.c b/dlls/user32/wsprintf.c index 7f98bee01a6..6cb4912f901 100644 --- a/dlls/user32/wsprintf.c +++ b/dlls/user32/wsprintf.c @@ -385,7 +385,7 @@ static INT16 wvsnprintf16( LPSTR buffer, UINT16 maxlen, LPCSTR spec, VA_LIST16 a /*********************************************************************** * wvsnprintfA (internal) */ -static INT wvsnprintfA( LPSTR buffer, UINT maxlen, LPCSTR spec, va_list args ) +static INT wvsnprintfA( LPSTR buffer, UINT maxlen, LPCSTR spec, __ms_va_list args ) { WPRINTF_FORMAT format; LPSTR p = buffer; @@ -488,7 +488,7 @@ static INT wvsnprintfA( LPSTR buffer, UINT maxlen, LPCSTR spec, va_list args ) /*********************************************************************** * wvsnprintfW (internal) */ -static INT wvsnprintfW( LPWSTR buffer, UINT maxlen, LPCWSTR spec, va_list args ) +static INT wvsnprintfW( LPWSTR buffer, UINT maxlen, LPCWSTR spec, __ms_va_list args ) { WPRINTF_FORMAT format; LPWSTR p = buffer; @@ -603,7 +603,7 @@ INT16 WINAPI wvsprintf16( LPSTR buffer, LPCSTR spec, VA_LIST16 args ) /*********************************************************************** * wvsprintfA (USER32.@) */ -INT WINAPI wvsprintfA( LPSTR buffer, LPCSTR spec, va_list args ) +INT WINAPI wvsprintfA( LPSTR buffer, LPCSTR spec, __ms_va_list args ) { INT res = wvsnprintfA( buffer, 1024, spec, args ); return ( res == -1 ) ? 1024 : res; @@ -613,7 +613,7 @@ INT WINAPI wvsprintfA( LPSTR buffer, LPCSTR spec, va_list args ) /*********************************************************************** * wvsprintfW (USER32.@) */ -INT WINAPI wvsprintfW( LPWSTR buffer, LPCWSTR spec, va_list args ) +INT WINAPI wvsprintfW( LPWSTR buffer, LPCWSTR spec, __ms_va_list args ) { INT res = wvsnprintfW( buffer, 1024, spec, args ); return ( res == -1 ) ? 1024 : res; @@ -637,12 +637,12 @@ INT16 WINAPIV wsprintf16( LPSTR buffer, LPCSTR spec, VA_LIST16 valist ) */ INT WINAPIV wsprintfA( LPSTR buffer, LPCSTR spec, ... ) { - va_list valist; + __ms_va_list valist; INT res; - va_start( valist, spec ); + __ms_va_start( valist, spec ); res = wvsnprintfA( buffer, 1024, spec, valist ); - va_end( valist ); + __ms_va_end( valist ); return ( res == -1 ) ? 1024 : res; } @@ -652,11 +652,11 @@ INT WINAPIV wsprintfA( LPSTR buffer, LPCSTR spec, ... ) */ INT WINAPIV wsprintfW( LPWSTR buffer, LPCWSTR spec, ... ) { - va_list valist; + __ms_va_list valist; INT res; - va_start( valist, spec ); + __ms_va_start( valist, spec ); res = wvsnprintfW( buffer, 1024, spec, valist ); - va_end( valist ); + __ms_va_end( valist ); return ( res == -1 ) ? 1024 : res; } diff --git a/include/windef.h b/include/windef.h index 3c9de7a9137..825255b537b 100644 --- a/include/windef.h +++ b/include/windef.h @@ -84,6 +84,18 @@ extern "C" { # endif #endif /* __cdecl */ +#ifndef __ms_va_list +# if defined(__x86_64__) && defined (__GNUC__) +# define __ms_va_list __builtin_ms_va_list +# define __ms_va_start(list,arg) __builtin_ms_va_start(list,arg) +# define __ms_va_end(list) __builtin_ms_va_end(list) +# else +# define __ms_va_list va_list +# define __ms_va_start(list,arg) va_start(list,arg) +# define __ms_va_end(list) va_end(list) +# endif +#endif + #ifdef __WINESRC__ #define __ONLY_IN_WINELIB(x) do_not_use_this_in_wine #else diff --git a/include/winuser.h b/include/winuser.h index 8382a07f22f..fd91d9292c0 100644 --- a/include/winuser.h +++ b/include/winuser.h @@ -5068,8 +5068,8 @@ WINUSERAPI VOID WINAPI mouse_event(DWORD,DWORD,DWORD,DWORD,ULONG_PTR); WINUSERAPI INT WINAPIV wsprintfA(LPSTR,LPCSTR,...); WINUSERAPI INT WINAPIV wsprintfW(LPWSTR,LPCWSTR,...); #define wsprintf WINELIB_NAME_AW(wsprintf) -WINUSERAPI INT WINAPI wvsprintfA(LPSTR,LPCSTR,va_list); -WINUSERAPI INT WINAPI wvsprintfW(LPWSTR,LPCWSTR,va_list); +WINUSERAPI INT WINAPI wvsprintfA(LPSTR,LPCSTR,__ms_va_list); +WINUSERAPI INT WINAPI wvsprintfW(LPWSTR,LPCWSTR,__ms_va_list); #define wvsprintf WINELIB_NAME_AW(wvsprintf) /* Undocumented functions */