openbsd-ports/devel/glib/patches/patch-glib_h
2001-03-12 03:55:05 +00:00

41 lines
786 B
Plaintext

--- glib.h.orig Mon Feb 26 22:44:38 2001
+++ glib.h Sun Mar 11 22:30:51 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 @@
* 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 @@
#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))