$OpenBSD: patch-glib_gmacros_h,v 1.13 2010/09/30 07:17:19 ajacoutot Exp $
--- glib/gmacros.h.orig	Mon Aug  9 15:34:46 2010
+++ glib/gmacros.h	Mon Sep 27 14:42:36 2010
@@ -38,6 +38,7 @@
 /* We include stddef.h to get the system's definition of NULL
  */
 #include <stddef.h>
+#include <sys/param.h>
 
 /* 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__ */
@@ -194,11 +200,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))
