$OpenBSD: patch-glib_h,v 1.4 2007/12/11 10:57:25 jakemsr Exp $
--- glib.h.orig	Mon Feb 26 22:44:38 2001
+++ glib.h	Thu Sep 20 00:13:09 2001
@@ -27,6 +27,8 @@
 #ifndef __G_LIB_H__
 #define __G_LIB_H__
 
+#include <sys/param.h>
+
 /* system specific config file glibconfig.h provides definitions for
  * the extrema of many of the standard types. These are:
  *
@@ -119,8 +121,12 @@ extern "C" {
  *  defined then the current definition is correct.
  */
 #ifndef	NULL
+#ifdef __cplusplus
+#define	NULL	(0)
+#else
 #define	NULL	((void*) 0)
 #endif
+#endif
 
 #ifndef	FALSE
 #define	FALSE	(0)
@@ -130,11 +136,13 @@ extern "C" {
 #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))