diff --git a/include/msvcrt/process.h b/include/msvcrt/process.h index 376ecc937c8..aa53d39de4b 100644 --- a/include/msvcrt/process.h +++ b/include/msvcrt/process.h @@ -34,12 +34,25 @@ typedef unsigned short MSVCRT(wchar_t); #define _WAIT_CHILD 0 #define _WAIT_GRANDCHILD 1 +#ifndef __stdcall +# ifdef __i386__ +# ifdef __GNUC__ +# define __stdcall __attribute__((__stdcall__)) +# elif defined(_MSC_VER) + /* Nothing needs to be done. __stdcall already exists */ +# else +# error You need to define __stdcall for your compiler +# endif +# else /* __i386__ */ +# define __stdcall +# endif /* __i386__ */ +#endif /* __stdcall */ #ifdef __cplusplus extern "C" { #endif -typedef void (__cdecl *_beginthread_start_routine_t)(void *); +typedef void (*_beginthread_start_routine_t)(void *); typedef unsigned int (__stdcall *_beginthreadex_start_routine_t)(void *); unsigned long _beginthread(_beginthread_start_routine_t,unsigned int,void*); diff --git a/include/windef.h b/include/windef.h index daf3e22397e..4e9de1495b8 100644 --- a/include/windef.h +++ b/include/windef.h @@ -41,22 +41,31 @@ extern "C" { /* Calling conventions definitions */ -#ifdef __i386__ -# ifndef _X86_ -# define _X86_ +#if defined(__i386__) && !defined(_X86_) +# define _X86_ +#endif + +#ifndef __stdcall +# ifdef __i386__ +# ifdef __GNUC__ +# define __stdcall __attribute__((__stdcall__)) +# elif defined(_MSC_VER) + /* Nothing needs to be done. __stdcall already exists */ +# else +# error You need to define __stdcall for your compiler +# endif +# else /* __i386__ */ +# define __stdcall +# endif /* __i386__ */ +#endif /* __stdcall */ + +#ifndef __cdecl +# if defined(__i386__) && defined(__GNUC__) +# define __cdecl __attribute__((__cdecl__)) +# elif !defined(_MSC_VER) +# define __cdecl # endif -# if defined(__GNUC__) && ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 7))) -# define __stdcall __attribute__((__stdcall__)) -# define __cdecl __attribute__((__cdecl__)) -# elif defined(_MSC_VER) -/* Nothing needs to be done. __cdecl/__stdcall already exists */ -# else -# error You need gcc >= 2.7 to build Wine on a 386 -# endif /* __GNUC__ */ -#else /* __i386__ */ -# define __stdcall -# define __cdecl -#endif /* __i386__ */ +#endif /* __stdcall */ #ifndef __WINESRC__