* include/_mingw.h: Undefine __attribute__.

(__MINGW_ATTR_NORETURN): New define.
	(__MINGW_ATTR_CONST): New define.
	(__MINGW_ATTR_MALLOC): New define.
	(__MINGW_ATTR_PURE): New define.
	(_CRTIMP, __cdecl, __stdcall, __UNUSED_PARAM): Ansi-fy
	expansions.
This commit is contained in:
Danny Smith 2004-07-21 10:59:54 +00:00
parent 7d9c458d8f
commit cc054d9d26
2 changed files with 36 additions and 7 deletions

View File

@ -1,3 +1,13 @@
2004-07-21 Danny Smith <dannysmith@users.sourceforge.net>
* include/_mingw.h: Undefine __attribute__.
(__MINGW_ATTR_NORETURN): New define.
(__MINGW_ATTR_CONST): New define.
(__MINGW_ATTR_MALLOC): New define.
(__MINGW_ATTR_PURE): New define.
(_CRTIMP, __cdecl, __stdcall, __UNUSED_PARAM): Ansi-fy
expansions.
2004-07-19 Danny Smith <dannysmith@users.sourceforge.net> 2004-07-19 Danny Smith <dannysmith@users.sourceforge.net>
* include/time.h (__time64_t): Add missing ';'. * include/time.h (__time64_t): Add missing ';'.

View File

@ -37,13 +37,16 @@
Other macros: Other macros:
__int64 define to be long long. Using a typedef can __int64 define to be long long. Using a typedef doesn't
tweak bugs in the C++ parser. work for "unsigned __int64"
All headers should include this first, and then use __DECLSPEC_SUPPORTED All headers should include this first, and then use __DECLSPEC_SUPPORTED
to choose between the old ``__imp__name'' style or __MINGW_IMPORT to choose between the old ``__imp__name'' style or __MINGW_IMPORT
style declarations. */ style declarations. */
/* Try to avoid problems with outdated checks for GCC __attribute__ support. */
#undef __attribute__
#ifndef __GNUC__ #ifndef __GNUC__
# ifndef __MINGW_IMPORT # ifndef __MINGW_IMPORT
# define __MINGW_IMPORT __declspec(dllimport) # define __MINGW_IMPORT __declspec(dllimport)
@ -58,11 +61,11 @@
# ifndef __MINGW_IMPORT # ifndef __MINGW_IMPORT
/* Note the extern. This is needed to work around GCC's /* Note the extern. This is needed to work around GCC's
limitations in handling dllimport attribute. */ limitations in handling dllimport attribute. */
# define __MINGW_IMPORT extern __attribute__((dllimport)) # define __MINGW_IMPORT extern __attribute__ ((dllimport))
# endif # endif
# ifndef _CRTIMP # ifndef _CRTIMP
# ifdef __USE_CRTIMP # ifdef __USE_CRTIMP
# define _CRTIMP __attribute__((dllimport)) # define _CRTIMP __attribute__ ((dllimport))
# else # else
# define _CRTIMP # define _CRTIMP
# endif # endif
@ -76,10 +79,10 @@
# endif # endif
# endif /* __declspec */ # endif /* __declspec */
# ifndef __cdecl # ifndef __cdecl
# define __cdecl __attribute__((cdecl)) # define __cdecl __attribute__ ((__cdecl__))
# endif # endif
# ifndef __stdcall # ifndef __stdcall
# define __stdcall __attribute__((stdcall)) # define __stdcall __attribute__ ((__stdcall__))
# endif # endif
# ifndef __int64 # ifndef __int64
# define __int64 long long # define __int64 long long
@ -111,12 +114,28 @@
# define __UNUSED_PARAM(x) # define __UNUSED_PARAM(x)
#else #else
# ifdef __GNUC__ # ifdef __GNUC__
# define __UNUSED_PARAM(x) x __attribute__((unused)) # define __UNUSED_PARAM(x) x __attribute__ ((__unused__))
# else # else
# define __UNUSED_PARAM(x) x # define __UNUSED_PARAM(x) x
# endif # endif
#endif #endif
#ifdef __GNUC__
#define __MINGW_ATTR_NORETURN __attribute__ ((__noreturn__))
#define __MINGW_ATTR_CONST __attribute__ ((__const__))
#else
#define __MINGW_ATTR_NORETURN
#define __MINGW_ATTR_CONST
#endif
#if ( __GNUC__ >= 3)
#define __MINGW_ATTR_MALLOC __attribute__ ((__malloc__))
#define __MINGW_ATTR_PURE __attribute__ ((__pure__))
#else
#define __MINGW_ATTR_MALLOC
#define __MINGW_ATTR_PURE
#endif
#ifndef __MSVCRT_VERSION__ #ifndef __MSVCRT_VERSION__
/* High byte is the major version, low byte is the minor. */ /* High byte is the major version, low byte is the minor. */
# define __MSVCRT_VERSION__ 0x0600 # define __MSVCRT_VERSION__ 0x0600