summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorkleink <kleink@NetBSD.org>1999-12-22 21:26:15 +0000
committerkleink <kleink@NetBSD.org>1999-12-22 21:26:15 +0000
commitc07f17e8d97d719e01f9d9075adf032b93149487 (patch)
tree2058ad046919ec928aa1445f943f294bfdf4d60c /include
parent7ec3575193b6f52a02091d6a931bd222cd9f10ab (diff)
For the benefit of G++'s null pointer constant implementation, #define NULL
as __null with egcs 1.0 (GCC 2.90) and above. As several headers are affected by this change, move the definition into a new header file, <null.h>, to ease maintenance.
Diffstat (limited to 'include')
-rw-r--r--include/Makefile11
-rw-r--r--include/dirent.h6
-rw-r--r--include/locale.h6
-rw-r--r--include/null.h9
-rw-r--r--include/stddef.h6
-rw-r--r--include/stdio.h6
-rw-r--r--include/stdlib.h6
-rw-r--r--include/string.h6
-rw-r--r--include/strings.h6
-rw-r--r--include/time.h6
-rw-r--r--include/unistd.h6
11 files changed, 33 insertions, 41 deletions
diff --git a/include/Makefile b/include/Makefile
index 5460600a4ac..716c8c82f6d 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.79 1999/09/13 18:38:04 kleink Exp $
+# $NetBSD: Makefile,v 1.80 1999/12/22 21:26:16 kleink Exp $
# @(#)Makefile 8.2 (Berkeley) 1/4/94
SRCTOP= ..
@@ -13,10 +13,11 @@ INCS= a.out.h ar.h assert.h bitstring.h bm.h cpio.h ctype.h db.h dirent.h \
glob.h grp.h hesiod.h ieeefp.h iso646.h kvm.h langinfo.h libgen.h \
limits.h link.h link_aout.h link_elf.h locale.h malloc.h math.h md4.h \
memory.h mpool.h ndbm.h netdb.h netgroup.h nlist.h nl_types.h \
- nsswitch.h paths.h pwd.h ranlib.h re_comp.h regex.h regexp.h resolv.h \
- rmt.h search.h setjmp.h sgtty.h signal.h stab.h stddef.h stdio.h \
- stdlib.h string.h strings.h stringlist.h struct.h sysexits.h tar.h \
- time.h ttyent.h tzfile.h ulimit.h unistd.h util.h utime.h utmp.h vis.h
+ nsswitch.h null.h paths.h pwd.h ranlib.h re_comp.h regex.h regexp.h \
+ resolv.h rmt.h search.h setjmp.h sgtty.h signal.h stab.h stddef.h \
+ stdio.h stdlib.h string.h strings.h stringlist.h struct.h sysexits.h \
+ tar.h time.h ttyent.h tzfile.h ulimit.h unistd.h util.h utime.h \
+ utmp.h vis.h
INCS+= arpa/ftp.h arpa/inet.h arpa/nameser.h arpa/telnet.h arpa/tftp.h
INCS+= protocols/dumprestore.h protocols/routed.h protocols/rwhod.h \
protocols/talkd.h protocols/timed.h
diff --git a/include/dirent.h b/include/dirent.h
index 4f01bb86910..efe2195ebdd 100644
--- a/include/dirent.h
+++ b/include/dirent.h
@@ -1,4 +1,4 @@
-/* $NetBSD: dirent.h,v 1.14 1998/05/06 19:05:51 kleink Exp $ */
+/* $NetBSD: dirent.h,v 1.15 1999/12/22 21:26:17 kleink Exp $ */
/*-
* Copyright (c) 1989, 1993
@@ -78,9 +78,7 @@ typedef struct _dirdesc {
#define DTF_REWIND 0x0004 /* rewind after reading union stack */
#define __DTF_READALL 0x0008 /* everything has been read */
-#ifndef NULL
-#define NULL 0
-#endif
+#include <null.h>
#endif /* _POSIX_C_SOURCE || _XOPEN_SOURCE */
diff --git a/include/locale.h b/include/locale.h
index c7e976b73a0..91e71f6eba4 100644
--- a/include/locale.h
+++ b/include/locale.h
@@ -1,4 +1,4 @@
-/* $NetBSD: locale.h,v 1.7 1998/02/02 21:07:29 perry Exp $ */
+/* $NetBSD: locale.h,v 1.8 1999/12/22 21:26:17 kleink Exp $ */
/*
* Copyright (c) 1991, 1993
@@ -59,9 +59,7 @@ struct lconv {
char n_sign_posn;
};
-#ifndef NULL
-#define NULL 0
-#endif
+#include <null.h>
#define LC_ALL 0
#define LC_COLLATE 1
diff --git a/include/null.h b/include/null.h
new file mode 100644
index 00000000000..58bda436510
--- /dev/null
+++ b/include/null.h
@@ -0,0 +1,9 @@
+/* $NetBSD: null.h,v 1.1 1999/12/22 21:26:17 kleink Exp $ */
+
+#ifndef NULL
+#if !defined(__GNUG__) || __GNUG__ < 2 || (__GNUG__ == 2 && __GNUC_MINOR__ < 90)
+#define NULL 0
+#else
+#define NULL __null
+#endif
+#endif
diff --git a/include/stddef.h b/include/stddef.h
index 39e4ea73e88..0b3b84445b1 100644
--- a/include/stddef.h
+++ b/include/stddef.h
@@ -1,4 +1,4 @@
-/* $NetBSD: stddef.h,v 1.5 1998/02/02 17:13:49 perry Exp $ */
+/* $NetBSD: stddef.h,v 1.6 1999/12/22 21:26:18 kleink Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -52,9 +52,7 @@ typedef _BSD_WCHAR_T_ wchar_t;
#undef _BSD_WCHAR_T_
#endif
-#ifndef NULL
-#define NULL 0
-#endif
+#include <null.h>
#define offsetof(type, member) ((size_t)(&((type *)0)->member))
diff --git a/include/stdio.h b/include/stdio.h
index eee3f76ce35..64505234d88 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -1,4 +1,4 @@
-/* $NetBSD: stdio.h,v 1.30 1998/11/20 14:39:38 kleink Exp $ */
+/* $NetBSD: stdio.h,v 1.31 1999/12/22 21:26:18 kleink Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -54,9 +54,7 @@ typedef _BSD_SIZE_T_ size_t;
#undef _BSD_SIZE_T_
#endif
-#ifndef NULL
-#define NULL 0
-#endif
+#include <null.h>
/*
* This is fairly grotesque, but pure ANSI code must not inspect the
diff --git a/include/stdlib.h b/include/stdlib.h
index 8c944d0422d..6c841a216fd 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -1,4 +1,4 @@
-/* $NetBSD: stdlib.h,v 1.42 1999/02/06 15:04:05 kleink Exp $ */
+/* $NetBSD: stdlib.h,v 1.43 1999/12/22 21:26:19 kleink Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -77,9 +77,7 @@ typedef struct {
#endif
-#ifndef NULL
-#define NULL 0
-#endif
+#include <null.h>
#define EXIT_FAILURE 1
#define EXIT_SUCCESS 0
diff --git a/include/string.h b/include/string.h
index 971059a5bea..e05a19f19d7 100644
--- a/include/string.h
+++ b/include/string.h
@@ -1,4 +1,4 @@
-/* $NetBSD: string.h,v 1.20 1999/09/09 09:30:40 kleink Exp $ */
+/* $NetBSD: string.h,v 1.21 1999/12/22 21:26:19 kleink Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -44,9 +44,7 @@ typedef _BSD_SIZE_T_ size_t;
#undef _BSD_SIZE_T_
#endif
-#ifndef NULL
-#define NULL 0
-#endif
+#include <null.h>
#include <sys/cdefs.h>
#include <sys/featuretest.h>
diff --git a/include/strings.h b/include/strings.h
index 367121a327c..cdf76bc73b4 100644
--- a/include/strings.h
+++ b/include/strings.h
@@ -1,4 +1,4 @@
-/* $NetBSD: strings.h,v 1.6 1998/05/06 17:12:45 kleink Exp $ */
+/* $NetBSD: strings.h,v 1.7 1999/12/22 21:26:19 kleink Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -48,9 +48,7 @@ typedef _BSD_SIZE_T_ size_t;
#endif
#ifndef _XOPEN_SOURCE
-#ifndef NULL
-#define NULL 0
-#endif
+#include <null.h>
#endif
#include <sys/cdefs.h>
diff --git a/include/time.h b/include/time.h
index 75aa54f388b..e4d2187feab 100644
--- a/include/time.h
+++ b/include/time.h
@@ -1,4 +1,4 @@
-/* $NetBSD: time.h,v 1.22 1998/09/15 12:24:28 kleink Exp $ */
+/* $NetBSD: time.h,v 1.23 1999/12/22 21:26:20 kleink Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -48,9 +48,7 @@
#include <machine/ansi.h>
#include <machine/limits.h> /* Include file containing CLK_TCK. */
-#ifndef NULL
-#define NULL 0
-#endif
+#include <null.h>
#ifdef _BSD_CLOCK_T_
typedef _BSD_CLOCK_T_ clock_t;
diff --git a/include/unistd.h b/include/unistd.h
index b4018aae671..b4383158ea4 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -1,4 +1,4 @@
-/* $NetBSD: unistd.h,v 1.78 1999/12/02 13:15:55 kleink Exp $ */
+/* $NetBSD: unistd.h,v 1.79 1999/12/22 21:26:20 kleink Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -88,9 +88,7 @@
#define STDOUT_FILENO 1 /* standard output file descriptor */
#define STDERR_FILENO 2 /* standard error file descriptor */
-#ifndef NULL
-#define NULL 0 /* null pointer constant */
-#endif
+#include <null.h>
__BEGIN_DECLS
__dead void _exit __P((int)) __attribute__((__noreturn__));