$OpenBSD: patch-glib_gmacros_h,v 1.12 2009/11/26 08:00:43 ajacoutot Exp $ --- glib/gmacros.h.orig Wed Apr 1 01:04:20 2009 +++ glib/gmacros.h Sat Nov 21 14:38:24 2009 @@ -38,6 +38,7 @@ /* We include stddef.h to get the system's definition of NULL */ #include +#include /* Here we provide G_GNUC_EXTENSION as an alias for __extension__, * where this is valid. This allows for warningless compilation of @@ -86,8 +87,13 @@ __attribute__((__noreturn__)) #define G_GNUC_CONST \ __attribute__((__const__)) +/* __attribute__((unused)) works with gcc3.3 but not g++3.3 */ +#if __GNUC__ == 3 && __GNUC_MINOR__ == 3 && !defined(__cplusplus) #define G_GNUC_UNUSED \ __attribute__((__unused__)) +#else +#define G_GNUC_UNUSED +#endif #define G_GNUC_NO_INSTRUMENT \ __attribute__((__no_instrument_function__)) #else /* !__GNUC__ */ @@ -187,11 +193,13 @@ #define TRUE (!FALSE) #endif -#undef MAX +#ifndef MAX #define MAX(a, b) (((a) > (b)) ? (a) : (b)) +#endif -#undef MIN +#ifndef MIN #define MIN(a, b) (((a) < (b)) ? (a) : (b)) +#endif #undef ABS #define ABS(a) (((a) < 0) ? -(a) : (a))