/* Calling conventions definitions */
-#if defined(__i386__) && !defined(_X86_)
-# define _X86_
-#endif
-
-#if defined(_X86_) && !defined(__i386__)
-# define __i386__
-#endif
-
#if defined(__x86_64__) && !defined(_WIN64)
#define _WIN64
#endif
+#ifndef _WIN64
+# if defined(__i386__) && !defined(_X86_)
+# define _X86_
+# endif
+# if defined(_X86_) && !defined(__i386__)
+# define __i386__
+# endif
+#endif
+
#ifndef __stdcall
# ifdef __i386__
# ifdef __GNUC__
# else
# error You need to define __stdcall for your compiler
# endif
+# elif defined(__x86_64__) && defined (__GNUC__)
+# define __stdcall __attribute__((ms_abi))
# else /* __i386__ */
# define __stdcall
# endif /* __i386__ */
# else
# define __cdecl __attribute__((__cdecl__))
# endif
+# elif defined(__x86_64__) && defined (__GNUC__)
+# define __cdecl __attribute__((ms_abi))
# elif !defined(_MSC_VER)
# define __cdecl
# 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
/* Note that Winelib is purely Win32. */
#ifdef __WINESRC__
-#define WINE_NO_UNICODE_MACROS
+#define WINE_NO_UNICODE_MACROS 1
+#define WINE_STRICT_PROTOTYPES 1
#endif
#ifdef WINE_NO_UNICODE_MACROS
/* Callback function pointers types */
+#ifdef WINE_STRICT_PROTOTYPES
+typedef INT_PTR (CALLBACK *FARPROC)(void);
+typedef INT_PTR (CALLBACK *NEARPROC)(void);
+typedef INT_PTR (CALLBACK *PROC)(void);
+#else
typedef INT_PTR (CALLBACK *FARPROC)();
typedef INT_PTR (CALLBACK *NEARPROC)();
typedef INT_PTR (CALLBACK *PROC)();
-
+#endif
/* Macros to split words and longs. */