Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src For the benefit of G++'s null pointer constant implementatio...
details: https://anonhg.NetBSD.org/src/rev/a220909e9296
branches: trunk
changeset: 479828:a220909e9296
user: kleink <kleink%NetBSD.org@localhost>
date: Wed Dec 22 21:26:15 1999 +0000
description:
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:
include/Makefile | 11 ++++++-----
include/dirent.h | 6 ++----
include/locale.h | 6 ++----
include/null.h | 9 +++++++++
include/stddef.h | 6 ++----
include/stdio.h | 6 ++----
include/stdlib.h | 6 ++----
include/string.h | 6 ++----
include/strings.h | 6 ++----
include/time.h | 6 ++----
include/unistd.h | 6 ++----
sys/sys/param.h | 9 ++++++---
12 files changed, 39 insertions(+), 44 deletions(-)
diffs (245 lines):
diff -r 08d381c5b907 -r a220909e9296 include/Makefile
--- a/include/Makefile Wed Dec 22 18:57:47 1999 +0000
+++ b/include/Makefile Wed Dec 22 21:26:15 1999 +0000
@@ -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 @@
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 -r 08d381c5b907 -r a220909e9296 include/dirent.h
--- a/include/dirent.h Wed Dec 22 18:57:47 1999 +0000
+++ b/include/dirent.h Wed Dec 22 21:26:15 1999 +0000
@@ -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 @@
#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 -r 08d381c5b907 -r a220909e9296 include/locale.h
--- a/include/locale.h Wed Dec 22 18:57:47 1999 +0000
+++ b/include/locale.h Wed Dec 22 21:26:15 1999 +0000
@@ -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 @@
char n_sign_posn;
};
-#ifndef NULL
-#define NULL 0
-#endif
+#include <null.h>
#define LC_ALL 0
#define LC_COLLATE 1
diff -r 08d381c5b907 -r a220909e9296 include/null.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/include/null.h Wed Dec 22 21:26:15 1999 +0000
@@ -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 -r 08d381c5b907 -r a220909e9296 include/stddef.h
--- a/include/stddef.h Wed Dec 22 18:57:47 1999 +0000
+++ b/include/stddef.h Wed Dec 22 21:26:15 1999 +0000
@@ -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 @@
#undef _BSD_WCHAR_T_
#endif
-#ifndef NULL
-#define NULL 0
-#endif
+#include <null.h>
#define offsetof(type, member) ((size_t)(&((type *)0)->member))
diff -r 08d381c5b907 -r a220909e9296 include/stdio.h
--- a/include/stdio.h Wed Dec 22 18:57:47 1999 +0000
+++ b/include/stdio.h Wed Dec 22 21:26:15 1999 +0000
@@ -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 @@
#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 -r 08d381c5b907 -r a220909e9296 include/stdlib.h
--- a/include/stdlib.h Wed Dec 22 18:57:47 1999 +0000
+++ b/include/stdlib.h Wed Dec 22 21:26:15 1999 +0000
@@ -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 @@
#endif
-#ifndef NULL
-#define NULL 0
-#endif
+#include <null.h>
#define EXIT_FAILURE 1
#define EXIT_SUCCESS 0
diff -r 08d381c5b907 -r a220909e9296 include/string.h
--- a/include/string.h Wed Dec 22 18:57:47 1999 +0000
+++ b/include/string.h Wed Dec 22 21:26:15 1999 +0000
@@ -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 @@
#undef _BSD_SIZE_T_
#endif
-#ifndef NULL
-#define NULL 0
-#endif
+#include <null.h>
#include <sys/cdefs.h>
#include <sys/featuretest.h>
diff -r 08d381c5b907 -r a220909e9296 include/strings.h
--- a/include/strings.h Wed Dec 22 18:57:47 1999 +0000
+++ b/include/strings.h Wed Dec 22 21:26:15 1999 +0000
@@ -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 @@
#endif
#ifndef _XOPEN_SOURCE
-#ifndef NULL
-#define NULL 0
-#endif
+#include <null.h>
#endif
#include <sys/cdefs.h>
diff -r 08d381c5b907 -r a220909e9296 include/time.h
--- a/include/time.h Wed Dec 22 18:57:47 1999 +0000
+++ b/include/time.h Wed Dec 22 21:26:15 1999 +0000
@@ -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 -r 08d381c5b907 -r a220909e9296 include/unistd.h
--- a/include/unistd.h Wed Dec 22 18:57:47 1999 +0000
+++ b/include/unistd.h Wed Dec 22 21:26:15 1999 +0000
@@ -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__));
diff -r 08d381c5b907 -r a220909e9296 sys/sys/param.h
--- a/sys/sys/param.h Wed Dec 22 18:57:47 1999 +0000
+++ b/sys/sys/param.h Wed Dec 22 21:26:15 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: param.h,v 1.78 1999/12/04 21:13:19 ragge Exp $ */
+/* $NetBSD: param.h,v 1.79 1999/12/22 21:26:15 kleink Exp $ */
/*-
* Copyright (c) 1982, 1986, 1989, 1993
@@ -81,12 +81,15 @@
#define NetBSD 199905 /* NetBSD version (year & month). */
+#ifdef _KERNEL
#ifndef NULL
#define NULL 0
-#endif
+#endif /* NULL */
+#else
+#include <null.h>
+#endif /* _KERNEL */
#ifndef _LOCORE
-#include <sys/inttypes.h>
#include <sys/types.h>
#endif
Home |
Main Index |
Thread Index |
Old Index