summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2011-07-03 18:51:01 +0000
committerjsg <jsg@openbsd.org>2011-07-03 18:51:01 +0000
commitc4ff7bee639643ef725c8a40babe8ec8b7971541 (patch)
tree0790a96b5c1922f9601f90302f363e5b106642da
parentgarbage collect unused parameter to PFLOG_PACKET (diff)
downloadwireguard-openbsd-c4ff7bee639643ef725c8a40babe8ec8b7971541.tar.xz
wireguard-openbsd-c4ff7bee639643ef725c8a40babe8ec8b7971541.zip
As pointed out by Richard Guenther our definition
of NULL was incorrect for c++ compilers that aren't gcc (or pretend to be gcc like clang). ok miod@
-rw-r--r--include/dirent.h4
-rw-r--r--include/locale.h4
-rw-r--r--include/stddef.h4
-rw-r--r--include/stdio.h4
-rw-r--r--include/stdlib.h4
-rw-r--r--include/string.h4
-rw-r--r--include/time.h4
-rw-r--r--include/unistd.h4
-rw-r--r--include/wchar.h4
9 files changed, 27 insertions, 9 deletions
diff --git a/include/dirent.h b/include/dirent.h
index ef1c1bafc95..d91c2658527 100644
--- a/include/dirent.h
+++ b/include/dirent.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dirent.h,v 1.21 2011/04/06 11:39:42 miod Exp $ */
+/* $OpenBSD: dirent.h,v 1.22 2011/07/03 18:51:01 jsg Exp $ */
/* $NetBSD: dirent.h,v 1.9 1995/03/26 20:13:37 jtc Exp $ */
/*-
@@ -84,6 +84,8 @@ typedef struct _dirdesc {
#ifndef NULL
#ifdef __GNUG__
#define NULL __null
+#elif defined(__cplusplus)
+#define NULL 0L
#else
#define NULL ((void *)0)
#endif /* __GNUG__ */
diff --git a/include/locale.h b/include/locale.h
index dfff586aca5..80f82b65c25 100644
--- a/include/locale.h
+++ b/include/locale.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: locale.h,v 1.7 2011/04/06 11:39:42 miod Exp $ */
+/* $OpenBSD: locale.h,v 1.8 2011/07/03 18:51:01 jsg Exp $ */
/* $NetBSD: locale.h,v 1.6 1994/10/26 00:56:02 cgd Exp $ */
/*
@@ -59,6 +59,8 @@ struct lconv {
#ifndef NULL
#ifdef __GNUG__
#define NULL __null
+#elif defined(__cplusplus)
+#define NULL 0L
#else
#define NULL ((void *)0)
#endif
diff --git a/include/stddef.h b/include/stddef.h
index 97c8e9510de..52b2b39dad6 100644
--- a/include/stddef.h
+++ b/include/stddef.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: stddef.h,v 1.11 2011/04/06 11:39:42 miod Exp $ */
+/* $OpenBSD: stddef.h,v 1.12 2011/07/03 18:51:01 jsg Exp $ */
/* $NetBSD: stddef.h,v 1.4 1994/10/26 00:56:26 cgd Exp $ */
/*-
@@ -67,6 +67,8 @@ typedef __mbstate_t mbstate_t;
#ifndef NULL
#ifdef __GNUG__
#define NULL __null
+#elif defined(__cplusplus)
+#define NULL 0L
#else
#define NULL ((void *)0)
#endif
diff --git a/include/stdio.h b/include/stdio.h
index aeb48f1535c..5304e552ac7 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: stdio.h,v 1.39 2011/04/06 11:39:42 miod Exp $ */
+/* $OpenBSD: stdio.h,v 1.40 2011/07/03 18:51:01 jsg Exp $ */
/* $NetBSD: stdio.h,v 1.18 1996/04/25 18:29:21 jtc Exp $ */
/*-
@@ -58,6 +58,8 @@ typedef __off_t off_t;
#ifndef NULL
#ifdef __GNUG__
#define NULL __null
+#elif defined(__cplusplus)
+#define NULL 0L
#else
#define NULL ((void *)0)
#endif
diff --git a/include/stdlib.h b/include/stdlib.h
index da29a50fc2d..bbd57544d16 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: stdlib.h,v 1.48 2011/04/06 11:39:42 miod Exp $ */
+/* $OpenBSD: stdlib.h,v 1.49 2011/07/03 18:51:01 jsg Exp $ */
/* $NetBSD: stdlib.h,v 1.25 1995/12/27 21:19:08 jtc Exp $ */
/*-
@@ -80,6 +80,8 @@ typedef struct {
#ifndef NULL
#ifdef __GNUG__
#define NULL __null
+#elif defined(__cplusplus)
+#define NULL 0L
#else
#define NULL ((void *)0)
#endif
diff --git a/include/string.h b/include/string.h
index f3ae14e15c2..3e754a83bc2 100644
--- a/include/string.h
+++ b/include/string.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: string.h,v 1.21 2011/04/06 11:39:42 miod Exp $ */
+/* $OpenBSD: string.h,v 1.22 2011/07/03 18:51:01 jsg Exp $ */
/* $NetBSD: string.h,v 1.6 1994/10/26 00:56:30 cgd Exp $ */
/*-
@@ -46,6 +46,8 @@ typedef __size_t size_t;
#ifndef NULL
#ifdef __GNUG__
#define NULL __null
+#elif defined(__cplusplus)
+#define NULL 0L
#else
#define NULL ((void *)0)
#endif
diff --git a/include/time.h b/include/time.h
index eb6936d4448..e17db2199f9 100644
--- a/include/time.h
+++ b/include/time.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: time.h,v 1.19 2011/04/06 11:39:42 miod Exp $ */
+/* $OpenBSD: time.h,v 1.20 2011/07/03 18:51:01 jsg Exp $ */
/* $NetBSD: time.h,v 1.9 1994/10/26 00:56:35 cgd Exp $ */
/*
@@ -47,6 +47,8 @@
#ifndef NULL
#ifdef __GNUG__
#define NULL __null
+#elif defined(__cplusplus)
+#define NULL 0L
#else
#define NULL ((void *)0)
#endif
diff --git a/include/unistd.h b/include/unistd.h
index 4edcae76007..92d91a795d2 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: unistd.h,v 1.63 2011/04/06 11:39:42 miod Exp $ */
+/* $OpenBSD: unistd.h,v 1.64 2011/07/03 18:51:01 jsg Exp $ */
/* $NetBSD: unistd.h,v 1.26.4.1 1996/05/28 02:31:51 mrg Exp $ */
/*-
@@ -58,6 +58,8 @@
#ifndef NULL
#ifdef __GNUG__
#define NULL __null
+#elif defined(__cplusplus)
+#define NULL 0L
#else
#define NULL ((void *)0)
#endif
diff --git a/include/wchar.h b/include/wchar.h
index 23030ee7a3f..b590b7a8fed 100644
--- a/include/wchar.h
+++ b/include/wchar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: wchar.h,v 1.17 2011/06/01 16:39:07 millert Exp $ */
+/* $OpenBSD: wchar.h,v 1.18 2011/07/03 18:51:01 jsg Exp $ */
/* $NetBSD: wchar.h,v 1.16 2003/03/07 07:11:35 tshiozak Exp $ */
/*-
@@ -65,6 +65,8 @@
#ifndef NULL
#ifdef __GNUG__
#define NULL __null
+#elif defined(__cplusplus)
+#define NULL 0L
#else
#define NULL ((void *)0)
#endif