diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog index 50c426364..55bd53656 100644 --- a/winsup/mingw/ChangeLog +++ b/winsup/mingw/ChangeLog @@ -1,3 +1,7 @@ +2009-07-18 Gregory McGarry + + * include/_mingw.h: Changes required for PCC compiler. + 2009-07-18 Jeff Lu * mingwex/usleep.c: round up to next ms diff --git a/winsup/mingw/include/_mingw.h b/winsup/mingw/include/_mingw.h index 22da4c953..3c59157b2 100644 --- a/winsup/mingw/include/_mingw.h +++ b/winsup/mingw/include/_mingw.h @@ -76,16 +76,46 @@ /* Try to avoid problems with outdated checks for GCC __attribute__ support. */ #undef __attribute__ -#ifndef __GNUC__ +#if defined (__PCC__) +# undef __DECLSPEC_SUPPORTED # ifndef __MINGW_IMPORT -# define __MINGW_IMPORT __declspec(dllimport) +# define __MINGW_IMPORT extern # endif # ifndef _CRTIMP -# define _CRTIMP __declspec(dllimport) +# define _CRTIMP # endif -# define __DECLSPEC_SUPPORTED -# define __attribute__(x) /* nothing */ -#else /* __GNUC__ */ +# ifndef __cdecl +# define __cdecl _Pragma("cdecl") +# endif +# ifndef __stdcall +# define __stdcall _Pragma("stdcall") +# endif +# ifndef __int64 +# define __int64 long long +# endif +# ifndef __int32 +# define __int32 long +# endif +# ifndef __int16 +# define __int16 short +# endif +# ifndef __int8 +# define __int8 char +# endif +# ifndef __small +# define __small char +# endif +# ifndef __hyper +# define __hyper long long +# endif +# ifndef __volatile__ +# define __volatile__ volatile +# endif +# ifndef __restrict__ +# define __restrict__ restrict +# endif +# define NONAMELESSUNION +#elif defined(__GNUC__) # ifdef __declspec # ifndef __MINGW_IMPORT /* Note the extern. This is needed to work around GCC's @@ -107,12 +137,11 @@ # define _CRTIMP # endif # endif /* __declspec */ - /* - The next two defines can cause problems if user code adds the __cdecl attribute - like so: - void __attribute__ ((__cdecl)) foo(void); -*/ + * The next two defines can cause problems if user code adds the + * __cdecl attribute like so: + * void __attribute__ ((__cdecl)) foo(void); + */ # ifndef __cdecl # define __cdecl __attribute__ ((__cdecl__)) # endif @@ -137,7 +166,16 @@ # ifndef __hyper # define __hyper long long # endif -#endif /* __GNUC__ */ +#else /* ! __GNUC__ && ! __PCC__ */ +# ifndef __MINGW_IMPORT +# define __MINGW_IMPORT __declspec(dllimport) +# endif +# ifndef _CRTIMP +# define _CRTIMP __declspec(dllimport) +# endif +# define __DECLSPEC_SUPPORTED +# define __attribute__(x) /* nothing */ +#endif #if defined (__GNUC__) && defined (__GNUC_MINOR__) #define __MINGW_GNUC_PREREQ(major, minor) \