aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMarcel Moolenaar <marcel@FreeBSD.org>2003-12-07 21:10:06 +0000
committerMarcel Moolenaar <marcel@FreeBSD.org>2003-12-07 21:10:06 +0000
commit12eb46c8bb2bf8a79a8151f4bd96aa7ce5bfe63d (patch)
tree9b033e9ca59d72fe94f812d9b6d08476039b8049 /sys
parent4fb638c32958057a1a08cde4dc4ce567b4540f7d (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/rpc/types.h4
-rw-r--r--sys/sys/_null.h37
-rw-r--r--sys/sys/param.h6
-rw-r--r--sys/sys/stddef.h5
4 files changed, 41 insertions, 11 deletions
diff --git a/sys/rpc/types.h b/sys/rpc/types.h
index 4a5c6564b270e..58d22a8a5416a 100644
--- a/sys/rpc/types.h
+++ b/sys/rpc/types.h
@@ -40,6 +40,7 @@
#define _RPC_TYPES_H
#include <sys/types.h>
+#include <sys/_null.h>
typedef int32_t bool_t;
typedef int32_t enum_t;
@@ -59,9 +60,6 @@ typedef int32_t rpc_inline_t;
#ifndef TRUE
# define TRUE (1)
#endif
-#ifndef NULL
-# define NULL 0
-#endif
#define mem_alloc(bsize) calloc(1, bsize)
#define mem_free(ptr, bsize) free(ptr)
diff --git a/sys/sys/_null.h b/sys/sys/_null.h
new file mode 100644
index 0000000000000..682fea4006ecd
--- /dev/null
+++ b/sys/sys/_null.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2003 Marcel Moolenaar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef NULL
+
+#ifdef __LP64__
+#define NULL 0L
+#else
+#define NULL 0
+#endif
+
+#endif
diff --git a/sys/sys/param.h b/sys/sys/param.h
index cf423ba2b57ea..28b18e8758604 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -42,6 +42,8 @@
#ifndef _SYS_PARAM_H_
#define _SYS_PARAM_H_
+#include <sys/_null.h>
+
#define BSD 199506 /* System version (year & month). */
#define BSD4_3 1
#define BSD4_4 1
@@ -59,10 +61,6 @@
#undef __FreeBSD_version
#define __FreeBSD_version 502100 /* Master, propagated to newvers */
-#ifndef NULL
-#define NULL 0
-#endif
-
#ifndef LOCORE
#include <sys/types.h>
#endif
diff --git a/sys/sys/stddef.h b/sys/sys/stddef.h
index 4104564553a3f..8e7f206d61971 100644
--- a/sys/sys/stddef.h
+++ b/sys/sys/stddef.h
@@ -30,14 +30,11 @@
#define _SYS_STDDEF_H_
#include <sys/cdefs.h>
+#include <sys/_null.h>
#include <machine/_types.h>
typedef __ptrdiff_t ptrdiff_t;
#define offsetof(type, field) __offsetof(type, field)
-#ifndef NULL
-#define NULL 0
-#endif
-
#endif /* !_SYS_STDDEF_H_ */