Commit 6366775e authored by Alexandre Julliard's avatar Alexandre Julliard

include: Disallow Win32 va_list in Unix libraries.

parent e20b1431
...@@ -6271,37 +6271,6 @@ printf "%s\n" "$wine_cv_cc_m32" >&6; } ...@@ -6271,37 +6271,6 @@ printf "%s\n" "$wine_cv_cc_m32" >&6; }
export PKG_CONFIG_LIBDIR export PKG_CONFIG_LIBDIR
with_unwind=${with_unwind:-no} with_unwind=${with_unwind:-no}
else else
if test "x${GCC}" = "xyes"
then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports __builtin_ms_va_list" >&5
printf %s "checking whether $CC supports __builtin_ms_va_list... " >&6; }
if test ${wine_cv_builtin_ms_va_list+y}
then :
printf %s "(cached) " >&6
else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdarg.h>
int
main (void)
{
void func(__builtin_ms_va_list *args);
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
wine_cv_builtin_ms_va_list=yes
else $as_nop
wine_cv_builtin_ms_va_list=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_builtin_ms_va_list" >&5
printf "%s\n" "$wine_cv_builtin_ms_va_list" >&6; }
test $wine_cv_builtin_ms_va_list != no || as_fn_error $? "You need gcc >= 4.4 or clang >= 3.8 to build Wine as 64-bit." "$LINENO" 5
fi
CC="$CC -m64" CC="$CC -m64"
CXX="$CXX -m64" CXX="$CXX -m64"
host_cpu="x86_64" host_cpu="x86_64"
......
...@@ -134,13 +134,6 @@ case $host in ...@@ -134,13 +134,6 @@ case $host in
export PKG_CONFIG_LIBDIR export PKG_CONFIG_LIBDIR
with_unwind=${with_unwind:-no} with_unwind=${with_unwind:-no}
else else
if test "x${GCC}" = "xyes"
then
AC_CACHE_CHECK([whether $CC supports __builtin_ms_va_list],wine_cv_builtin_ms_va_list,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>]], [[void func(__builtin_ms_va_list *args);]])],
[wine_cv_builtin_ms_va_list=yes],[wine_cv_builtin_ms_va_list=no])])
test $wine_cv_builtin_ms_va_list != no || AC_MSG_ERROR([You need gcc >= 4.4 or clang >= 3.8 to build Wine as 64-bit.])
fi
CC="$CC -m64" CC="$CC -m64"
CXX="$CXX -m64" CXX="$CXX -m64"
host_cpu="x86_64" host_cpu="x86_64"
......
...@@ -1728,6 +1728,8 @@ DECLARE_INTERFACE_(IDebugSymbols3, IUnknown) ...@@ -1728,6 +1728,8 @@ DECLARE_INTERFACE_(IDebugSymbols3, IUnknown)
}; };
#undef INTERFACE #undef INTERFACE
#ifdef __ms_va_list
#define INTERFACE IDebugControl #define INTERFACE IDebugControl
DECLARE_INTERFACE_(IDebugControl, IUnknown) DECLARE_INTERFACE_(IDebugControl, IUnknown)
{ {
...@@ -2336,6 +2338,8 @@ DECLARE_INTERFACE_(IDebugControl4, IUnknown) ...@@ -2336,6 +2338,8 @@ DECLARE_INTERFACE_(IDebugControl4, IUnknown)
}; };
#undef INTERFACE #undef INTERFACE
#endif /* __ms_va_list */
#define INTERFACE IDebugAdvanced #define INTERFACE IDebugAdvanced
DECLARE_INTERFACE_(IDebugAdvanced, IUnknown) DECLARE_INTERFACE_(IDebugAdvanced, IUnknown)
{ {
......
...@@ -309,7 +309,9 @@ ULONG WINAPI StartTraceW(PTRACEHANDLE,LPCWSTR,PEVENT_TRACE_PROPERTIES); ...@@ -309,7 +309,9 @@ ULONG WINAPI StartTraceW(PTRACEHANDLE,LPCWSTR,PEVENT_TRACE_PROPERTIES);
#define StartTrace WINELIB_NAME_AW(StartTrace) #define StartTrace WINELIB_NAME_AW(StartTrace)
ULONG WINAPI TraceEvent(TRACEHANDLE,PEVENT_TRACE_HEADER); ULONG WINAPI TraceEvent(TRACEHANDLE,PEVENT_TRACE_HEADER);
ULONG WINAPIV TraceMessage(TRACEHANDLE,ULONG,LPGUID,USHORT,...); ULONG WINAPIV TraceMessage(TRACEHANDLE,ULONG,LPGUID,USHORT,...);
#ifdef __ms_va_list
ULONG WINAPI TraceMessageVa(TRACEHANDLE,ULONG,LPGUID,USHORT,__ms_va_list); ULONG WINAPI TraceMessageVa(TRACEHANDLE,ULONG,LPGUID,USHORT,__ms_va_list);
#endif
ULONG WINAPI UnregisterTraceGuids(TRACEHANDLE); ULONG WINAPI UnregisterTraceGuids(TRACEHANDLE);
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -945,9 +945,11 @@ WINSHLWAPI BOOL WINAPI StrTrimA(LPSTR,LPCSTR); ...@@ -945,9 +945,11 @@ WINSHLWAPI BOOL WINAPI StrTrimA(LPSTR,LPCSTR);
WINSHLWAPI BOOL WINAPI StrTrimW(LPWSTR,LPCWSTR); WINSHLWAPI BOOL WINAPI StrTrimW(LPWSTR,LPCWSTR);
#define StrTrim WINELIB_NAME_AW(StrTrim) #define StrTrim WINELIB_NAME_AW(StrTrim)
#ifdef __ms_va_list
WINSHLWAPI INT WINAPI wvnsprintfA(LPSTR,INT,LPCSTR,__ms_va_list); WINSHLWAPI INT WINAPI wvnsprintfA(LPSTR,INT,LPCSTR,__ms_va_list);
WINSHLWAPI INT WINAPI wvnsprintfW(LPWSTR,INT,LPCWSTR,__ms_va_list); WINSHLWAPI INT WINAPI wvnsprintfW(LPWSTR,INT,LPCWSTR,__ms_va_list);
#define wvnsprintf WINELIB_NAME_AW(wvnsprintf) #define wvnsprintf WINELIB_NAME_AW(wvnsprintf)
#endif
WINSHLWAPI INT WINAPIV wnsprintfA(LPSTR,INT,LPCSTR, ...); WINSHLWAPI INT WINAPIV wnsprintfA(LPSTR,INT,LPCSTR, ...);
WINSHLWAPI INT WINAPIV wnsprintfW(LPWSTR,INT,LPCWSTR, ...); WINSHLWAPI INT WINAPIV wnsprintfW(LPWSTR,INT,LPCWSTR, ...);
......
...@@ -2116,9 +2116,11 @@ WINBASEAPI BOOL WINAPI FlushFileBuffers(HANDLE); ...@@ -2116,9 +2116,11 @@ WINBASEAPI BOOL WINAPI FlushFileBuffers(HANDLE);
WINBASEAPI BOOL WINAPI FlushInstructionCache(HANDLE,LPCVOID,SIZE_T); WINBASEAPI BOOL WINAPI FlushInstructionCache(HANDLE,LPCVOID,SIZE_T);
WINBASEAPI VOID WINAPI FlushProcessWriteBuffers(void); WINBASEAPI VOID WINAPI FlushProcessWriteBuffers(void);
WINBASEAPI BOOL WINAPI FlushViewOfFile(LPCVOID,SIZE_T); WINBASEAPI BOOL WINAPI FlushViewOfFile(LPCVOID,SIZE_T);
#ifdef __ms_va_list
WINBASEAPI DWORD WINAPI FormatMessageA(DWORD,LPCVOID,DWORD,DWORD,LPSTR,DWORD,__ms_va_list*); WINBASEAPI DWORD WINAPI FormatMessageA(DWORD,LPCVOID,DWORD,DWORD,LPSTR,DWORD,__ms_va_list*);
WINBASEAPI DWORD WINAPI FormatMessageW(DWORD,LPCVOID,DWORD,DWORD,LPWSTR,DWORD,__ms_va_list*); WINBASEAPI DWORD WINAPI FormatMessageW(DWORD,LPCVOID,DWORD,DWORD,LPWSTR,DWORD,__ms_va_list*);
#define FormatMessage WINELIB_NAME_AW(FormatMessage) #define FormatMessage WINELIB_NAME_AW(FormatMessage)
#endif
WINBASEAPI BOOL WINAPI FreeEnvironmentStringsA(LPSTR); WINBASEAPI BOOL WINAPI FreeEnvironmentStringsA(LPSTR);
WINBASEAPI BOOL WINAPI FreeEnvironmentStringsW(LPWSTR); WINBASEAPI BOOL WINAPI FreeEnvironmentStringsW(LPWSTR);
#define FreeEnvironmentStrings WINELIB_NAME_AW(FreeEnvironmentStrings) #define FreeEnvironmentStrings WINELIB_NAME_AW(FreeEnvironmentStrings)
......
...@@ -56,37 +56,38 @@ extern "C" { ...@@ -56,37 +56,38 @@ extern "C" {
#if !defined(_MSC_VER) && !defined(__MINGW32__) #if !defined(_MSC_VER) && !defined(__MINGW32__)
#undef __stdcall
#undef __cdecl
#undef __fastcall
#undef __thiscall
#ifdef WINE_UNIX_LIB #ifdef WINE_UNIX_LIB
# define __stdcall # define __stdcall
# define __cdecl # define __cdecl
# undef __fastcall #elif defined(__GNUC__)
#else
# undef __stdcall
# ifdef __i386__ # ifdef __i386__
# ifdef __GNUC__ # if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || defined(__APPLE__)
# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || defined(__APPLE__) # define __stdcall __attribute__((__stdcall__)) __attribute__((__force_align_arg_pointer__))
# define __stdcall __attribute__((__stdcall__)) __attribute__((__force_align_arg_pointer__))
# else
# define __stdcall __attribute__((__stdcall__))
# endif
# else # else
# error You need to define __stdcall for your compiler # define __stdcall __attribute__((__stdcall__))
# endif # endif
# elif defined(__x86_64__) && defined (__GNUC__) # elif defined(__x86_64__)
# if __has_attribute(__force_align_arg_pointer__) # if __has_attribute(__force_align_arg_pointer__)
# define __stdcall __attribute__((ms_abi)) __attribute__((__force_align_arg_pointer__)) # define __stdcall __attribute__((ms_abi)) __attribute__((__force_align_arg_pointer__))
# else # else
# define __stdcall __attribute__((ms_abi)) # define __stdcall __attribute__((ms_abi))
# endif # endif
# elif defined(__arm__) && defined (__GNUC__) && !defined(__SOFTFP__) && !defined(__CYGWIN__) # define __ms_va_list __builtin_ms_va_list
# define __stdcall __attribute__((pcs("aapcs-vfp"))) # elif defined(__arm__) && !defined(__SOFTFP__) && !defined(__CYGWIN__)
# elif defined(__aarch64__) && defined (__GNUC__) && __has_attribute(ms_abi) # define __stdcall __attribute__((pcs("aapcs-vfp")))
# define WINAPIV __attribute__((pcs("aapcs")))
# elif defined(__aarch64__) && __has_attribute(ms_abi)
# define __stdcall __attribute__((ms_abi)) # define __stdcall __attribute__((ms_abi))
# define __ms_va_list __builtin_ms_va_list
# else /* __i386__ */ # else /* __i386__ */
# define __stdcall # define __stdcall
# endif /* __i386__ */ # endif /* __i386__ */
# undef __cdecl # ifdef __i386__
# if defined(__i386__) && defined(__GNUC__)
# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || defined(__APPLE__) # if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || defined(__APPLE__)
# define __cdecl __attribute__((__cdecl__)) __attribute__((__force_align_arg_pointer__)) # define __cdecl __attribute__((__cdecl__)) __attribute__((__force_align_arg_pointer__))
# else # else
...@@ -95,38 +96,16 @@ extern "C" { ...@@ -95,38 +96,16 @@ extern "C" {
# else # else
# define __cdecl __stdcall # define __cdecl __stdcall
# endif # endif
# ifndef __fastcall # define __fastcall __stdcall
# define __fastcall __stdcall # define __thiscall __stdcall
# endif #elif !defined(RC_INVOKED)
# ifndef __thiscall # error You need to define __stdcall for your compiler
# define __thiscall __stdcall
# endif
#endif /* WINE_UNIX_LIB */ #endif /* WINE_UNIX_LIB */
#endif /* _MSC_VER || __MINGW32__ */ #endif /* _MSC_VER || __MINGW32__ */
#ifndef __ms_va_list #if !defined(__ms_va_list) && !defined(WINE_UNIX_LIB)
# if (defined(__x86_64__) || (defined(__aarch64__) && __has_attribute(ms_abi))) && defined (__GNUC__) # define __ms_va_list va_list
# 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)
# define __ms_va_copy(dest,src) __builtin_ms_va_copy(dest,src)
# 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)
# ifdef va_copy
# define __ms_va_copy(dest,src) va_copy(dest,src)
# else
# define __ms_va_copy(dest,src) ((dest) = (src))
# endif
# endif
#endif
#if defined(__arm__) && defined (__GNUC__) && !defined(__SOFTFP__) && !defined(__MINGW32__) && !defined(__CYGWIN__)
# define WINAPIV __attribute__((pcs("aapcs")))
#else
# define WINAPIV __cdecl
#endif #endif
#ifdef __WINESRC__ #ifdef __WINESRC__
...@@ -142,9 +121,6 @@ extern "C" { ...@@ -142,9 +121,6 @@ extern "C" {
#ifndef _fastcall #ifndef _fastcall
#define _fastcall __ONLY_IN_WINELIB(__stdcall) #define _fastcall __ONLY_IN_WINELIB(__stdcall)
#endif #endif
#ifndef __fastcall
#define __fastcall __ONLY_IN_WINELIB(__stdcall)
#endif
#ifndef cdecl #ifndef cdecl
#define cdecl __ONLY_IN_WINELIB(__cdecl) #define cdecl __ONLY_IN_WINELIB(__cdecl)
#endif #endif
...@@ -202,6 +178,9 @@ extern "C" { ...@@ -202,6 +178,9 @@ extern "C" {
#define _CDECL __cdecl #define _CDECL __cdecl
#define APIENTRY WINAPI #define APIENTRY WINAPI
#define CONST __ONLY_IN_WINELIB(const) #define CONST __ONLY_IN_WINELIB(const)
#ifndef WINAPIV
# define WINAPIV CDECL
#endif
/* Misc. constants. */ /* Misc. constants. */
......
...@@ -4567,8 +4567,10 @@ NTSYSAPI NTSTATUS WINAPI RtlFlsFree(ULONG); ...@@ -4567,8 +4567,10 @@ NTSYSAPI NTSTATUS WINAPI RtlFlsFree(ULONG);
NTSYSAPI NTSTATUS WINAPI RtlFlsGetValue(ULONG,void **); NTSYSAPI NTSTATUS WINAPI RtlFlsGetValue(ULONG,void **);
NTSYSAPI NTSTATUS WINAPI RtlFlsSetValue(ULONG,void *); NTSYSAPI NTSTATUS WINAPI RtlFlsSetValue(ULONG,void *);
NTSYSAPI NTSTATUS WINAPI RtlFormatCurrentUserKeyPath(PUNICODE_STRING); NTSYSAPI NTSTATUS WINAPI RtlFormatCurrentUserKeyPath(PUNICODE_STRING);
#ifdef __ms_va_list
NTSYSAPI NTSTATUS WINAPI RtlFormatMessage(LPCWSTR,ULONG,BOOLEAN,BOOLEAN,BOOLEAN,__ms_va_list *,LPWSTR,ULONG,ULONG*); NTSYSAPI NTSTATUS WINAPI RtlFormatMessage(LPCWSTR,ULONG,BOOLEAN,BOOLEAN,BOOLEAN,__ms_va_list *,LPWSTR,ULONG,ULONG*);
NTSYSAPI NTSTATUS WINAPI RtlFormatMessageEx(LPCWSTR,ULONG,BOOLEAN,BOOLEAN,BOOLEAN,__ms_va_list *,LPWSTR,ULONG,ULONG*,ULONG); NTSYSAPI NTSTATUS WINAPI RtlFormatMessageEx(LPCWSTR,ULONG,BOOLEAN,BOOLEAN,BOOLEAN,__ms_va_list *,LPWSTR,ULONG,ULONG*,ULONG);
#endif
NTSYSAPI void WINAPI RtlFreeActivationContextStack(ACTIVATION_CONTEXT_STACK *); NTSYSAPI void WINAPI RtlFreeActivationContextStack(ACTIVATION_CONTEXT_STACK *);
NTSYSAPI void WINAPI RtlFreeAnsiString(PANSI_STRING); NTSYSAPI void WINAPI RtlFreeAnsiString(PANSI_STRING);
NTSYSAPI BOOLEAN WINAPI RtlFreeHandle(RTL_HANDLE_TABLE *,RTL_HANDLE *); NTSYSAPI BOOLEAN WINAPI RtlFreeHandle(RTL_HANDLE_TABLE *,RTL_HANDLE *);
...@@ -4863,8 +4865,10 @@ NTSYSAPI void WINAPI TpWaitForIoCompletion(TP_IO *,BOOL); ...@@ -4863,8 +4865,10 @@ NTSYSAPI void WINAPI TpWaitForIoCompletion(TP_IO *,BOOL);
NTSYSAPI void WINAPI TpWaitForTimer(TP_TIMER *,BOOL); NTSYSAPI void WINAPI TpWaitForTimer(TP_TIMER *,BOOL);
NTSYSAPI void WINAPI TpWaitForWait(TP_WAIT *,BOOL); NTSYSAPI void WINAPI TpWaitForWait(TP_WAIT *,BOOL);
NTSYSAPI void WINAPI TpWaitForWork(TP_WORK *,BOOL); NTSYSAPI void WINAPI TpWaitForWork(TP_WORK *,BOOL);
#ifdef __ms_va_list
NTSYSAPI NTSTATUS WINAPI vDbgPrintEx(ULONG,ULONG,LPCSTR,__ms_va_list); NTSYSAPI NTSTATUS WINAPI vDbgPrintEx(ULONG,ULONG,LPCSTR,__ms_va_list);
NTSYSAPI NTSTATUS WINAPI vDbgPrintExWithPrefix(LPCSTR,ULONG,ULONG,LPCSTR,__ms_va_list); NTSYSAPI NTSTATUS WINAPI vDbgPrintExWithPrefix(LPCSTR,ULONG,ULONG,LPCSTR,__ms_va_list);
#endif
/* 32-bit or 64-bit only functions */ /* 32-bit or 64-bit only functions */
......
...@@ -4682,9 +4682,11 @@ WINUSERAPI VOID WINAPI mouse_event(DWORD,DWORD,DWORD,DWORD,ULONG_PTR); ...@@ -4682,9 +4682,11 @@ WINUSERAPI VOID WINAPI mouse_event(DWORD,DWORD,DWORD,DWORD,ULONG_PTR);
WINUSERAPI INT WINAPIV wsprintfA(LPSTR,LPCSTR,...); WINUSERAPI INT WINAPIV wsprintfA(LPSTR,LPCSTR,...);
WINUSERAPI INT WINAPIV wsprintfW(LPWSTR,LPCWSTR,...); WINUSERAPI INT WINAPIV wsprintfW(LPWSTR,LPCWSTR,...);
#define wsprintf WINELIB_NAME_AW(wsprintf) #define wsprintf WINELIB_NAME_AW(wsprintf)
#ifdef __ms_va_list
WINUSERAPI INT WINAPI wvsprintfA(LPSTR,LPCSTR,__ms_va_list); WINUSERAPI INT WINAPI wvsprintfA(LPSTR,LPCSTR,__ms_va_list);
WINUSERAPI INT WINAPI wvsprintfW(LPWSTR,LPCWSTR,__ms_va_list); WINUSERAPI INT WINAPI wvsprintfW(LPWSTR,LPCWSTR,__ms_va_list);
#define wvsprintf WINELIB_NAME_AW(wvsprintf) #define wvsprintf WINELIB_NAME_AW(wvsprintf)
#endif
#if !defined(__WINESRC__) || defined(WINE_NO_INLINE_RECT) #if !defined(__WINESRC__) || defined(WINE_NO_INLINE_RECT)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment