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; }
export PKG_CONFIG_LIBDIR
with_unwind=${with_unwind:-no}
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"
CXX="$CXX -m64"
host_cpu="x86_64"
......
......@@ -134,13 +134,6 @@ case $host in
export PKG_CONFIG_LIBDIR
with_unwind=${with_unwind:-no}
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"
CXX="$CXX -m64"
host_cpu="x86_64"
......
......@@ -1728,6 +1728,8 @@ DECLARE_INTERFACE_(IDebugSymbols3, IUnknown)
};
#undef INTERFACE
#ifdef __ms_va_list
#define INTERFACE IDebugControl
DECLARE_INTERFACE_(IDebugControl, IUnknown)
{
......@@ -2336,6 +2338,8 @@ DECLARE_INTERFACE_(IDebugControl4, IUnknown)
};
#undef INTERFACE
#endif /* __ms_va_list */
#define INTERFACE IDebugAdvanced
DECLARE_INTERFACE_(IDebugAdvanced, IUnknown)
{
......
......@@ -309,7 +309,9 @@ ULONG WINAPI StartTraceW(PTRACEHANDLE,LPCWSTR,PEVENT_TRACE_PROPERTIES);
#define StartTrace WINELIB_NAME_AW(StartTrace)
ULONG WINAPI TraceEvent(TRACEHANDLE,PEVENT_TRACE_HEADER);
ULONG WINAPIV TraceMessage(TRACEHANDLE,ULONG,LPGUID,USHORT,...);
#ifdef __ms_va_list
ULONG WINAPI TraceMessageVa(TRACEHANDLE,ULONG,LPGUID,USHORT,__ms_va_list);
#endif
ULONG WINAPI UnregisterTraceGuids(TRACEHANDLE);
#ifdef __cplusplus
......
......@@ -945,9 +945,11 @@ WINSHLWAPI BOOL WINAPI StrTrimA(LPSTR,LPCSTR);
WINSHLWAPI BOOL WINAPI StrTrimW(LPWSTR,LPCWSTR);
#define StrTrim WINELIB_NAME_AW(StrTrim)
#ifdef __ms_va_list
WINSHLWAPI INT WINAPI wvnsprintfA(LPSTR,INT,LPCSTR,__ms_va_list);
WINSHLWAPI INT WINAPI wvnsprintfW(LPWSTR,INT,LPCWSTR,__ms_va_list);
#define wvnsprintf WINELIB_NAME_AW(wvnsprintf)
#endif
WINSHLWAPI INT WINAPIV wnsprintfA(LPSTR,INT,LPCSTR, ...);
WINSHLWAPI INT WINAPIV wnsprintfW(LPWSTR,INT,LPCWSTR, ...);
......
......@@ -2116,9 +2116,11 @@ WINBASEAPI BOOL WINAPI FlushFileBuffers(HANDLE);
WINBASEAPI BOOL WINAPI FlushInstructionCache(HANDLE,LPCVOID,SIZE_T);
WINBASEAPI VOID WINAPI FlushProcessWriteBuffers(void);
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 FormatMessageW(DWORD,LPCVOID,DWORD,DWORD,LPWSTR,DWORD,__ms_va_list*);
#define FormatMessage WINELIB_NAME_AW(FormatMessage)
#endif
WINBASEAPI BOOL WINAPI FreeEnvironmentStringsA(LPSTR);
WINBASEAPI BOOL WINAPI FreeEnvironmentStringsW(LPWSTR);
#define FreeEnvironmentStrings WINELIB_NAME_AW(FreeEnvironmentStrings)
......
......@@ -56,37 +56,38 @@ extern "C" {
#if !defined(_MSC_VER) && !defined(__MINGW32__)
#undef __stdcall
#undef __cdecl
#undef __fastcall
#undef __thiscall
#ifdef WINE_UNIX_LIB
# define __stdcall
# define __cdecl
# undef __fastcall
#else
# undef __stdcall
#elif defined(__GNUC__)
# ifdef __i386__
# ifdef __GNUC__
# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || defined(__APPLE__)
# define __stdcall __attribute__((__stdcall__)) __attribute__((__force_align_arg_pointer__))
# else
# define __stdcall __attribute__((__stdcall__))
# endif
# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || defined(__APPLE__)
# define __stdcall __attribute__((__stdcall__)) __attribute__((__force_align_arg_pointer__))
# else
# error You need to define __stdcall for your compiler
# define __stdcall __attribute__((__stdcall__))
# endif
# elif defined(__x86_64__) && defined (__GNUC__)
# elif defined(__x86_64__)
# if __has_attribute(__force_align_arg_pointer__)
# define __stdcall __attribute__((ms_abi)) __attribute__((__force_align_arg_pointer__))
# else
# define __stdcall __attribute__((ms_abi))
# endif
# elif defined(__arm__) && defined (__GNUC__) && !defined(__SOFTFP__) && !defined(__CYGWIN__)
# define __stdcall __attribute__((pcs("aapcs-vfp")))
# elif defined(__aarch64__) && defined (__GNUC__) && __has_attribute(ms_abi)
# define __ms_va_list __builtin_ms_va_list
# elif defined(__arm__) && !defined(__SOFTFP__) && !defined(__CYGWIN__)
# define __stdcall __attribute__((pcs("aapcs-vfp")))
# define WINAPIV __attribute__((pcs("aapcs")))
# elif defined(__aarch64__) && __has_attribute(ms_abi)
# define __stdcall __attribute__((ms_abi))
# define __ms_va_list __builtin_ms_va_list
# else /* __i386__ */
# define __stdcall
# endif /* __i386__ */
# undef __cdecl
# if defined(__i386__) && defined(__GNUC__)
# ifdef __i386__
# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || defined(__APPLE__)
# define __cdecl __attribute__((__cdecl__)) __attribute__((__force_align_arg_pointer__))
# else
......@@ -95,38 +96,16 @@ extern "C" {
# else
# define __cdecl __stdcall
# endif
# ifndef __fastcall
# define __fastcall __stdcall
# endif
# ifndef __thiscall
# define __thiscall __stdcall
# endif
# define __fastcall __stdcall
# define __thiscall __stdcall
#elif !defined(RC_INVOKED)
# error You need to define __stdcall for your compiler
#endif /* WINE_UNIX_LIB */
#endif /* _MSC_VER || __MINGW32__ */
#ifndef __ms_va_list
# if (defined(__x86_64__) || (defined(__aarch64__) && __has_attribute(ms_abi))) && 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)
# 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
#if !defined(__ms_va_list) && !defined(WINE_UNIX_LIB)
# define __ms_va_list va_list
#endif
#ifdef __WINESRC__
......@@ -142,9 +121,6 @@ extern "C" {
#ifndef _fastcall
#define _fastcall __ONLY_IN_WINELIB(__stdcall)
#endif
#ifndef __fastcall
#define __fastcall __ONLY_IN_WINELIB(__stdcall)
#endif
#ifndef cdecl
#define cdecl __ONLY_IN_WINELIB(__cdecl)
#endif
......@@ -202,6 +178,9 @@ extern "C" {
#define _CDECL __cdecl
#define APIENTRY WINAPI
#define CONST __ONLY_IN_WINELIB(const)
#ifndef WINAPIV
# define WINAPIV CDECL
#endif
/* Misc. constants. */
......
......@@ -4567,8 +4567,10 @@ NTSYSAPI NTSTATUS WINAPI RtlFlsFree(ULONG);
NTSYSAPI NTSTATUS WINAPI RtlFlsGetValue(ULONG,void **);
NTSYSAPI NTSTATUS WINAPI RtlFlsSetValue(ULONG,void *);
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 RtlFormatMessageEx(LPCWSTR,ULONG,BOOLEAN,BOOLEAN,BOOLEAN,__ms_va_list *,LPWSTR,ULONG,ULONG*,ULONG);
#endif
NTSYSAPI void WINAPI RtlFreeActivationContextStack(ACTIVATION_CONTEXT_STACK *);
NTSYSAPI void WINAPI RtlFreeAnsiString(PANSI_STRING);
NTSYSAPI BOOLEAN WINAPI RtlFreeHandle(RTL_HANDLE_TABLE *,RTL_HANDLE *);
......@@ -4863,8 +4865,10 @@ NTSYSAPI void WINAPI TpWaitForIoCompletion(TP_IO *,BOOL);
NTSYSAPI void WINAPI TpWaitForTimer(TP_TIMER *,BOOL);
NTSYSAPI void WINAPI TpWaitForWait(TP_WAIT *,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 vDbgPrintExWithPrefix(LPCSTR,ULONG,ULONG,LPCSTR,__ms_va_list);
#endif
/* 32-bit or 64-bit only functions */
......
......@@ -4682,9 +4682,11 @@ 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)
#ifdef __ms_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)
#endif
#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