PERFORCE change 43166 for review
Marcel Moolenaar
marcel at FreeBSD.org
Sat Nov 29 20:36:18 PST 2003
http://perforce.freebsd.org/chv.cgi?CH=43166
Change 43166 by marcel at marcel_nfs on 2003/11/29 20:35:53
Move the definition of NULL into a seperate header <sys/null.h>
where we can tweak it without having to edit 12 header files.
On ia64 we need NULL to be a 64-bit constant to have the same
behavior there as we have on other platforms. This fixes gnome,
xemacs and whatever else.
Affected files ...
.. //depot/projects/ia64/include/dirent.h#6 edit
.. //depot/projects/ia64/include/locale.h#5 edit
.. //depot/projects/ia64/include/rpc/types.h#3 edit
.. //depot/projects/ia64/include/stddef.h#6 edit
.. //depot/projects/ia64/include/stdio.h#14 edit
.. //depot/projects/ia64/include/stdlib.h#22 edit
.. //depot/projects/ia64/include/string.h#11 edit
.. //depot/projects/ia64/include/time.h#11 edit
.. //depot/projects/ia64/include/unistd.h#21 edit
.. //depot/projects/ia64/include/wchar.h#15 edit
.. //depot/projects/ia64/sys/sys/null.h#1 add
.. //depot/projects/ia64/sys/sys/param.h#49 edit
.. //depot/projects/ia64/sys/sys/stddef.h#3 edit
Differences ...
==== //depot/projects/ia64/include/dirent.h#6 (text+ko) ====
@@ -81,9 +81,7 @@
#define DTF_REWIND 0x0004 /* rewind after reading union stack */
#define __DTF_READALL 0x0008 /* everything has been read */
-#ifndef NULL
-#define NULL 0L
-#endif
+#include <sys/null.h>
#else /* !__BSD_VISIBLE */
==== //depot/projects/ia64/include/locale.h#5 (text+ko) ====
@@ -37,6 +37,9 @@
#ifndef _LOCALE_H_
#define _LOCALE_H_
+#include <sys/cdefs.h>
+#include <sys/null.h>
+
struct lconv {
char *decimal_point;
char *thousands_sep;
@@ -64,10 +67,6 @@
char int_n_sign_posn;
};
-#ifndef NULL
-#define NULL 0L
-#endif
-
#define LC_ALL 0
#define LC_COLLATE 1
#define LC_CTYPE 2
@@ -78,8 +77,6 @@
#define _LC_LAST 7 /* marks end */
-#include <sys/cdefs.h>
-
__BEGIN_DECLS
struct lconv *localeconv(void);
char *setlocale(int, const char *);
==== //depot/projects/ia64/include/rpc/types.h#3 (text+ko) ====
@@ -39,6 +39,7 @@
#ifndef _RPC_TYPES_H
#define _RPC_TYPES_H
+#include <sys/null.h>
#include <sys/types.h>
typedef int32_t bool_t;
@@ -59,9 +60,6 @@
#ifndef TRUE
# define TRUE (1)
#endif
-#ifndef NULL
-# define NULL 0L
-#endif
#define mem_alloc(bsize) calloc(1, bsize)
#define mem_free(ptr, bsize) free(ptr)
==== //depot/projects/ia64/include/stddef.h#6 (text+ko) ====
@@ -39,6 +39,7 @@
#define _STDDEF_H_
#include <sys/cdefs.h>
+#include <sys/null.h>
#include <sys/_types.h>
typedef __ptrdiff_t ptrdiff_t;
@@ -62,10 +63,6 @@
#endif
#endif
-#ifndef NULL
-#define NULL 0L
-#endif
-
#define offsetof(type, member) __offsetof(type, member)
#endif /* _STDDEF_H_ */
==== //depot/projects/ia64/include/stdio.h#14 (text+ko) ====
@@ -41,6 +41,7 @@
#define _STDIO_H_
#include <sys/cdefs.h>
+#include <sys/null.h>
#include <sys/_types.h>
typedef __off_t fpos_t;
@@ -57,10 +58,6 @@
#endif
#endif
-#ifndef NULL
-#define NULL 0L
-#endif
-
#define _FSTDIO /* Define for new stdio with functions. */
/*
==== //depot/projects/ia64/include/stdlib.h#22 (text+ko) ====
@@ -69,9 +69,7 @@
long rem;
} ldiv_t;
-#ifndef NULL
-#define NULL 0L
-#endif
+#include <sys/null.h>
#define EXIT_FAILURE 1
#define EXIT_SUCCESS 0
==== //depot/projects/ia64/include/string.h#11 (text+ko) ====
@@ -38,6 +38,7 @@
#define _STRING_H_
#include <sys/cdefs.h>
+#include <sys/null.h>
#include <sys/_types.h>
/*
@@ -53,10 +54,6 @@
#define _SIZE_T_DECLARED
#endif
-#ifndef NULL
-#define NULL 0L
-#endif
-
__BEGIN_DECLS
#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
void *memccpy(void * __restrict, const void * __restrict, int, size_t);
==== //depot/projects/ia64/include/time.h#11 (text+ko) ====
@@ -46,6 +46,7 @@
#define _TIME_H_
#include <sys/cdefs.h>
+#include <sys/null.h>
#include <sys/_types.h>
#if __POSIX_VISIBLE > 0 && __POSIX_VISIBLE < 200112 || __BSD_VISIBLE
@@ -59,10 +60,6 @@
/* Frequency of the clock ticks reported by clock(). */
#define CLOCKS_PER_SEC 128
-#ifndef NULL
-#define NULL 0L
-#endif
-
#ifndef _CLOCK_T_DECLARED
typedef __clock_t clock_t;
#define _CLOCK_T_DECLARED
==== //depot/projects/ia64/include/unistd.h#21 (text+ko) ====
@@ -81,9 +81,7 @@
#define STDOUT_FILENO 1 /* standard output file descriptor */
#define STDERR_FILENO 2 /* standard error file descriptor */
-#ifndef NULL
-#define NULL 0L /* null pointer constant */
-#endif
+#include <sys/null.h>
#if __XSI_VISIBLE || __POSIX_VISIBLE >= 200112
#define F_ULOCK 0 /* unlock locked section */
==== //depot/projects/ia64/include/wchar.h#15 (text+ko) ====
@@ -68,13 +68,10 @@
#define _WCHAR_H_
#include <sys/cdefs.h>
+#include <sys/null.h>
#include <sys/_types.h>
#include <machine/_limits.h>
-#ifndef NULL
-#define NULL 0L
-#endif
-
#ifndef _MBSTATE_T_DECLARED
typedef __mbstate_t mbstate_t;
#define _MBSTATE_T_DECLARED
==== //depot/projects/ia64/sys/sys/param.h#49 (text+ko) ====
@@ -59,9 +59,7 @@
#undef __FreeBSD_version
#define __FreeBSD_version 501114 /* Master, propagated to newvers */
-#ifndef NULL
-#define NULL 0L
-#endif
+#include <sys/null.h>
#ifndef LOCORE
#include <sys/types.h>
==== //depot/projects/ia64/sys/sys/stddef.h#3 (text+ko) ====
@@ -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 0L
-#endif
-
#endif /* !_SYS_STDDEF_H_ */
More information about the p4-projects
mailing list