diff options
| author | jmc <jmc@NetBSD.org> | 2004-06-20 22:20:14 +0000 |
|---|---|---|
| committer | jmc <jmc@NetBSD.org> | 2004-06-20 22:20:14 +0000 |
| commit | b2f782612fe8c90c33dbac39f46b984e155e9d35 (patch) | |
| tree | 621fd229ae597b565c516ab4afd72b041cdfa672 /include | |
| parent | fa985b27a7846ade156387f98a002515d72661d9 (diff) | |
Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')
Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).
Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.
Fixes PR's: PR#17762 PR#25944
Diffstat (limited to 'include')
| -rw-r--r-- | include/getopt.h | 6 | ||||
| -rw-r--r-- | include/glob.h | 4 | ||||
| -rw-r--r-- | include/pwd.h | 4 |
3 files changed, 8 insertions, 6 deletions
diff --git a/include/getopt.h b/include/getopt.h index 46398d0718f..54ce7302142 100644 --- a/include/getopt.h +++ b/include/getopt.h @@ -1,4 +1,4 @@ -/* $NetBSD: getopt.h,v 1.5 2003/04/28 23:16:13 bjh21 Exp $ */ +/* $NetBSD: getopt.h,v 1.6 2004/06/20 22:20:14 jmc Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -46,7 +46,7 @@ /* * Gnu like getopt_long() and BSD4.4 getsubopt()/optreset extensions */ -#if defined(_NETBSD_SOURCE) +#if defined(_NETBSD_SOURCE) || defined(HAVE_NBTOOL_CONFIG_H) #define no_argument 0 #define required_argument 1 #define optional_argument 2 @@ -64,7 +64,9 @@ struct option { /* if flag not NULL, value to set *flag to; else return value */ int val; }; +#endif +#if defined(_NETBSD_SOURCE) __BEGIN_DECLS int getopt_long __P((int, char * const *, const char *, const struct option *, int *)); diff --git a/include/glob.h b/include/glob.h index cde42ef6f1e..eb2c164a68c 100644 --- a/include/glob.h +++ b/include/glob.h @@ -1,4 +1,4 @@ -/* $NetBSD: glob.h,v 1.17 2003/08/07 09:44:10 agc Exp $ */ +/* $NetBSD: glob.h,v 1.18 2004/06/20 22:20:14 jmc Exp $ */ /* * Copyright (c) 1989, 1993 @@ -81,7 +81,7 @@ typedef struct { #define GLOB_NOMATCH (-3) /* No match, and GLOB_NOCHECK was not set. */ #define GLOB_NOSYS (-4) /* Implementation does not support function. */ -#if defined(_NETBSD_SOURCE) +#if defined(_NETBSD_SOURCE) || defined(HAVE_NBTOOL_CONFIG_H) #define GLOB_ALTDIRFUNC 0x0040 /* Use alternately specified directory funcs. */ #define GLOB_BRACE 0x0080 /* Expand braces ala csh. */ #define GLOB_MAGCHAR 0x0100 /* Pattern had globbing characters. */ diff --git a/include/pwd.h b/include/pwd.h index a3d720e11cc..3cce0524142 100644 --- a/include/pwd.h +++ b/include/pwd.h @@ -1,4 +1,4 @@ -/* $NetBSD: pwd.h,v 1.32 2003/10/13 15:36:33 agc Exp $ */ +/* $NetBSD: pwd.h,v 1.33 2004/06/20 22:20:14 jmc Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -68,7 +68,7 @@ #include <sys/featuretest.h> #include <sys/types.h> -#if defined(_NETBSD_SOURCE) +#if defined(_NETBSD_SOURCE) || defined(HAVE_NBTOOL_CONFIG_H) #define _PATH_PASSWD "/etc/passwd" #define _PATH_MASTERPASSWD "/etc/master.passwd" #define _PATH_MASTERPASSWD_LOCK "/etc/ptmp" |
