diff options
author | Chris Sutcliffe <ir0nh34d@users.sourceforge.net> | 2009-07-18 14:56:47 +0000 |
---|---|---|
committer | Chris Sutcliffe <ir0nh34d@users.sourceforge.net> | 2009-07-18 14:56:47 +0000 |
commit | f9a5b8ea6a1cb5e5e758d2e18cca5849b2237671 (patch) | |
tree | 5da418cb81b4d5d7485b573b216ae65dfbe1c4f4 /winsup/mingw | |
parent | 52e4653d43a1a3e9eab7316ed735f1f1d83f3fdf (diff) | |
download | newlib-f9a5b8ea6a1cb5e5e758d2e18cca5849b2237671.zip newlib-f9a5b8ea6a1cb5e5e758d2e18cca5849b2237671.tar.gz newlib-f9a5b8ea6a1cb5e5e758d2e18cca5849b2237671.tar.bz2 |
2009-07-18 Gregory McGarry <gregorymcgarry@users.sourceforge.net>
* include/_mingw.h: Changes required for PCC compiler.
Diffstat (limited to 'winsup/mingw')
-rw-r--r-- | winsup/mingw/ChangeLog | 4 | ||||
-rw-r--r-- | winsup/mingw/include/_mingw.h | 62 |
2 files changed, 54 insertions, 12 deletions
diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog index 50c4263..55bd536 100644 --- a/winsup/mingw/ChangeLog +++ b/winsup/mingw/ChangeLog @@ -1,3 +1,7 @@ +2009-07-18 Gregory McGarry <gregorymcgarry@users.sourceforge.net> + + * include/_mingw.h: Changes required for PCC compiler. + 2009-07-18 Jeff Lu <jll544@yahoo.com> * mingwex/usleep.c: round up to next ms diff --git a/winsup/mingw/include/_mingw.h b/winsup/mingw/include/_mingw.h index 22da4c9..3c59157 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) \ |