+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>
* include/time.h (__time64_t): Add missing ';'.
Other macros:
- __int64 define to be long long. Using a typedef can
- tweak bugs in the C++ parser.
+ __int64 define to be long long. Using a typedef doesn't
+ work for "unsigned __int64"
All headers should include this first, and then use __DECLSPEC_SUPPORTED
to choose between the old ``__imp__name'' style or __MINGW_IMPORT
style declarations. */
+/* Try to avoid problems with outdated checks for GCC __attribute__ support. */
+#undef __attribute__
+
#ifndef __GNUC__
# ifndef __MINGW_IMPORT
# define __MINGW_IMPORT __declspec(dllimport)
# ifndef __MINGW_IMPORT
/* Note the extern. This is needed to work around GCC's
limitations in handling dllimport attribute. */
-# define __MINGW_IMPORT extern __attribute__((dllimport))
+# define __MINGW_IMPORT extern __attribute__ ((dllimport))
# endif
# ifndef _CRTIMP
# ifdef __USE_CRTIMP
-# define _CRTIMP __attribute__((dllimport))
+# define _CRTIMP __attribute__ ((dllimport))
# else
# define _CRTIMP
# endif
# endif
# endif /* __declspec */
# ifndef __cdecl
-# define __cdecl __attribute__((cdecl))
+# define __cdecl __attribute__ ((__cdecl__))
# endif
# ifndef __stdcall
-# define __stdcall __attribute__((stdcall))
+# define __stdcall __attribute__ ((__stdcall__))
# endif
# ifndef __int64
# define __int64 long long
# define __UNUSED_PARAM(x)
#else
# ifdef __GNUC__
-# define __UNUSED_PARAM(x) x __attribute__((unused))
+# define __UNUSED_PARAM(x) x __attribute__ ((__unused__))
# else
# define __UNUSED_PARAM(x) x
# 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__
/* High byte is the major version, low byte is the minor. */
# define __MSVCRT_VERSION__ 0x0600