Browse Source

Move the 10 (!) defintions of NULL to their own mini header file and

update the NULL definition for C++11.  OK deraadt@ guenther@ kettenis@
OPENBSD_6_1
millert 8 years ago
parent
commit
4c5bec1286
9 changed files with 19 additions and 100 deletions
  1. +2
    -10
      src/include/dirent.h
  2. +3
    -11
      src/include/locale.h
  3. +2
    -11
      src/include/stddef.h
  4. +2
    -11
      src/include/stdio.h
  5. +2
    -12
      src/include/stdlib.h
  6. +2
    -11
      src/include/string.h
  7. +2
    -11
      src/include/time.h
  8. +2
    -12
      src/include/unistd.h
  9. +2
    -11
      src/include/wchar.h

+ 2
- 10
src/include/dirent.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: dirent.h,v 1.33 2013/12/13 18:09:27 zhuk Exp $ */
/* $OpenBSD: dirent.h,v 1.34 2016/09/09 18:12:37 millert Exp $ */
/* $NetBSD: dirent.h,v 1.9 1995/03/26 20:13:37 jtc Exp $ */ /* $NetBSD: dirent.h,v 1.9 1995/03/26 20:13:37 jtc Exp $ */
/*- /*-
@ -63,15 +63,7 @@ typedef struct _dirdesc DIR;
/* definitions for library routines operating on directories. */ /* definitions for library routines operating on directories. */
#define DIRBLKSIZ 1024 #define DIRBLKSIZ 1024
#ifndef NULL
#ifdef __GNUG__
#define NULL __null
#elif defined(__cplusplus)
#define NULL 0L
#else
#define NULL ((void *)0)
#endif /* __GNUG__ */
#endif /* !NULL */
#include <sys/_null.h>
#endif /* __BSD_VISIBLE */ #endif /* __BSD_VISIBLE */


+ 3
- 11
src/include/locale.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: locale.h,v 1.9 2014/07/14 07:22:07 pelikan Exp $ */
/* $OpenBSD: locale.h,v 1.10 2016/09/09 18:12:37 millert Exp $ */
/* $NetBSD: locale.h,v 1.6 1994/10/26 00:56:02 cgd Exp $ */ /* $NetBSD: locale.h,v 1.6 1994/10/26 00:56:02 cgd Exp $ */
/* /*
@ -35,6 +35,8 @@
#ifndef _LOCALE_H_ #ifndef _LOCALE_H_
#define _LOCALE_H_ #define _LOCALE_H_
#include <sys/_null.h>
struct lconv { struct lconv {
char *decimal_point; char *decimal_point;
char *thousands_sep; char *thousands_sep;
@ -62,16 +64,6 @@ struct lconv {
char int_n_sign_posn; char int_n_sign_posn;
}; };
#ifndef NULL
#ifdef __GNUG__
#define NULL __null
#elif defined(__cplusplus)
#define NULL 0L
#else
#define NULL ((void *)0)
#endif
#endif
#define LC_ALL 0 #define LC_ALL 0
#define LC_COLLATE 1 #define LC_COLLATE 1
#define LC_CTYPE 2 #define LC_CTYPE 2


+ 2
- 11
src/include/stddef.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: stddef.h,v 1.12 2011/07/03 18:51:01 jsg Exp $ */
/* $OpenBSD: stddef.h,v 1.13 2016/09/09 18:12:37 millert Exp $ */
/* $NetBSD: stddef.h,v 1.4 1994/10/26 00:56:26 cgd Exp $ */ /* $NetBSD: stddef.h,v 1.4 1994/10/26 00:56:26 cgd Exp $ */
/*- /*-
@ -36,6 +36,7 @@
#define _STDDEF_H_ #define _STDDEF_H_
#include <sys/cdefs.h> #include <sys/cdefs.h>
#include <sys/_null.h>
#include <sys/_types.h> #include <sys/_types.h>
#ifndef _PTRDIFF_T_DEFINED_ #ifndef _PTRDIFF_T_DEFINED_
@ -64,16 +65,6 @@ typedef __wint_t wint_t;
typedef __mbstate_t mbstate_t; typedef __mbstate_t mbstate_t;
#endif #endif
#ifndef NULL
#ifdef __GNUG__
#define NULL __null
#elif defined(__cplusplus)
#define NULL 0L
#else
#define NULL ((void *)0)
#endif
#endif
#if __GNUC_PREREQ__(4, 0) #if __GNUC_PREREQ__(4, 0)
#define offsetof(type, member) __builtin_offsetof(type, member) #define offsetof(type, member) __builtin_offsetof(type, member)
#else #else


+ 2
- 11
src/include/stdio.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: stdio.h,v 1.52 2016/03/16 04:56:08 deraadt Exp $ */
/* $OpenBSD: stdio.h,v 1.53 2016/09/09 18:12:37 millert Exp $ */
/* $NetBSD: stdio.h,v 1.18 1996/04/25 18:29:21 jtc Exp $ */ /* $NetBSD: stdio.h,v 1.18 1996/04/25 18:29:21 jtc Exp $ */
/*- /*-
@ -39,6 +39,7 @@
#define _STDIO_H_ #define _STDIO_H_
#include <sys/cdefs.h> #include <sys/cdefs.h>
#include <sys/_null.h>
#include <sys/_types.h> #include <sys/_types.h>
#if __BSD_VISIBLE || __POSIX_VISIBLE || __XPG_VISIBLE #if __BSD_VISIBLE || __POSIX_VISIBLE || __XPG_VISIBLE
@ -55,16 +56,6 @@ typedef __size_t size_t;
typedef __off_t off_t; typedef __off_t off_t;
#endif #endif
#ifndef NULL
#ifdef __GNUG__
#define NULL __null
#elif defined(__cplusplus)
#define NULL 0L
#else
#define NULL ((void *)0)
#endif
#endif
#define _FSTDIO /* Define for new stdio with functions. */ #define _FSTDIO /* Define for new stdio with functions. */
typedef off_t fpos_t; /* stdio file position type */ typedef off_t fpos_t; /* stdio file position type */


+ 2
- 12
src/include/stdlib.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: stdlib.h,v 1.65 2015/07/14 19:05:11 millert Exp $ */
/* $OpenBSD: stdlib.h,v 1.66 2016/09/09 18:12:37 millert Exp $ */
/* $NetBSD: stdlib.h,v 1.25 1995/12/27 21:19:08 jtc Exp $ */ /* $NetBSD: stdlib.h,v 1.25 1995/12/27 21:19:08 jtc Exp $ */
/*- /*-
@ -36,6 +36,7 @@
#define _STDLIB_H_ #define _STDLIB_H_
#include <sys/cdefs.h> #include <sys/cdefs.h>
#include <sys/_null.h>
#include <machine/_types.h> #include <machine/_types.h>
#if __BSD_VISIBLE /* for quad_t, etc. (XXX - use protected types) */ #if __BSD_VISIBLE /* for quad_t, etc. (XXX - use protected types) */
#include <sys/types.h> #include <sys/types.h>
@ -76,17 +77,6 @@ typedef struct {
} qdiv_t; } qdiv_t;
#endif #endif
#ifndef NULL
#ifdef __GNUG__
#define NULL __null
#elif defined(__cplusplus)
#define NULL 0L
#else
#define NULL ((void *)0)
#endif
#endif
#define EXIT_FAILURE 1 #define EXIT_FAILURE 1
#define EXIT_SUCCESS 0 #define EXIT_SUCCESS 0


+ 2
- 11
src/include/string.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: string.h,v 1.30 2015/11/20 23:40:32 millert Exp $ */
/* $OpenBSD: string.h,v 1.31 2016/09/09 18:12:37 millert Exp $ */
/* $NetBSD: string.h,v 1.6 1994/10/26 00:56:30 cgd Exp $ */ /* $NetBSD: string.h,v 1.6 1994/10/26 00:56:30 cgd Exp $ */
/*- /*-
@ -36,6 +36,7 @@
#define _STRING_H_ #define _STRING_H_
#include <sys/cdefs.h> #include <sys/cdefs.h>
#include <sys/_null.h>
#include <machine/_types.h> #include <machine/_types.h>
/* /*
@ -51,16 +52,6 @@
typedef __size_t size_t; typedef __size_t size_t;
#endif #endif
#ifndef NULL
#ifdef __GNUG__
#define NULL __null
#elif defined(__cplusplus)
#define NULL 0L
#else
#define NULL ((void *)0)
#endif
#endif
__BEGIN_DECLS __BEGIN_DECLS
void *memchr(const void *, int, size_t); void *memchr(const void *, int, size_t);
int memcmp(const void *, const void *, size_t); int memcmp(const void *, const void *, size_t);


+ 2
- 11
src/include/time.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: time.h,v 1.28 2015/04/07 01:47:04 millert Exp $ */
/* $OpenBSD: time.h,v 1.29 2016/09/09 18:12:37 millert Exp $ */
/* $NetBSD: time.h,v 1.9 1994/10/26 00:56:35 cgd Exp $ */ /* $NetBSD: time.h,v 1.9 1994/10/26 00:56:35 cgd Exp $ */
/* /*
@ -42,18 +42,9 @@
#define _TIME_H_ #define _TIME_H_
#include <sys/cdefs.h> #include <sys/cdefs.h>
#include <sys/_null.h>
#include <sys/_types.h> #include <sys/_types.h>
#ifndef NULL
#ifdef __GNUG__
#define NULL __null
#elif defined(__cplusplus)
#define NULL 0L
#else
#define NULL ((void *)0)
#endif
#endif
#ifndef _CLOCK_T_DEFINED_ #ifndef _CLOCK_T_DEFINED_
#define _CLOCK_T_DEFINED_ #define _CLOCK_T_DEFINED_
typedef __clock_t clock_t; typedef __clock_t clock_t;


+ 2
- 12
src/include/unistd.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: unistd.h,v 1.101 2016/05/23 00:12:58 guenther Exp $ */
/* $OpenBSD: unistd.h,v 1.102 2016/09/09 18:12:37 millert Exp $ */
/* $NetBSD: unistd.h,v 1.26.4.1 1996/05/28 02:31:51 mrg Exp $ */ /* $NetBSD: unistd.h,v 1.26.4.1 1996/05/28 02:31:51 mrg Exp $ */
/*- /*-
@ -35,6 +35,7 @@
#ifndef _UNISTD_H_ #ifndef _UNISTD_H_
#define _UNISTD_H_ #define _UNISTD_H_
#include <sys/_null.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/unistd.h> #include <sys/unistd.h>
@ -314,17 +315,6 @@
#define _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS 30 #define _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS 30
#define _CS_V7_ENV 31 #define _CS_V7_ENV 31
#ifndef NULL
#ifdef __GNUG__
#define NULL __null
#elif defined(__cplusplus)
#define NULL 0L
#else
#define NULL ((void *)0)
#endif
#endif
#ifndef _INTPTR_T_DEFINED_ #ifndef _INTPTR_T_DEFINED_
#define _INTPTR_T_DEFINED_ #define _INTPTR_T_DEFINED_
typedef __intptr_t intptr_t; typedef __intptr_t intptr_t;


+ 2
- 11
src/include/wchar.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: wchar.h,v 1.29 2015/04/04 18:05:05 guenther Exp $ */
/* $OpenBSD: wchar.h,v 1.30 2016/09/09 18:12:37 millert Exp $ */
/* $NetBSD: wchar.h,v 1.16 2003/03/07 07:11:35 tshiozak Exp $ */ /* $NetBSD: wchar.h,v 1.16 2003/03/07 07:11:35 tshiozak Exp $ */
/*- /*-
@ -60,18 +60,9 @@
#define _WCHAR_H_ #define _WCHAR_H_
#include <sys/cdefs.h> #include <sys/cdefs.h>
#include <sys/_null.h>
#include <sys/_types.h> #include <sys/_types.h>
#ifndef NULL
#ifdef __GNUG__
#define NULL __null
#elif defined(__cplusplus)
#define NULL 0L
#else
#define NULL ((void *)0)
#endif
#endif
#include <stdio.h> /* for FILE* */ #include <stdio.h> /* for FILE* */
#if !defined(_WCHAR_T_DEFINED_) && !defined(__cplusplus) #if !defined(_WCHAR_T_DEFINED_) && !defined(__cplusplus)


Loading…
Cancel
Save