head 1.11; access; symbols netbsd-10-0-RC6:1.11 netbsd-10-0-RC5:1.11 netbsd-10-0-RC4:1.11 netbsd-10-0-RC3:1.11 netbsd-10-0-RC2:1.11 netbsd-10-0-RC1:1.11 netbsd-10:1.11.0.78 netbsd-10-base:1.11 netbsd-9-3-RELEASE:1.11 cjep_sun2x-base1:1.11 cjep_sun2x:1.11.0.76 cjep_sun2x-base:1.11 cjep_staticlib_x-base1:1.11 netbsd-9-2-RELEASE:1.11 cjep_staticlib_x:1.11.0.74 cjep_staticlib_x-base:1.11 netbsd-9-1-RELEASE:1.11 phil-wifi-20200421:1.11 phil-wifi-20200411:1.11 is-mlppp:1.11.0.72 is-mlppp-base:1.11 phil-wifi-20200406:1.11 netbsd-8-2-RELEASE:1.11 netbsd-9-0-RELEASE:1.11 netbsd-9-0-RC2:1.11 netbsd-9-0-RC1:1.11 phil-wifi-20191119:1.11 netbsd-9:1.11.0.70 netbsd-9-base:1.11 phil-wifi-20190609:1.11 netbsd-8-1-RELEASE:1.11 netbsd-8-1-RC1:1.11 pgoyette-compat-merge-20190127:1.11 pgoyette-compat-20190127:1.11 pgoyette-compat-20190118:1.11 pgoyette-compat-1226:1.11 pgoyette-compat-1126:1.11 pgoyette-compat-1020:1.11 pgoyette-compat-0930:1.11 pgoyette-compat-0906:1.11 netbsd-7-2-RELEASE:1.11 pgoyette-compat-0728:1.11 netbsd-8-0-RELEASE:1.11 phil-wifi:1.11.0.68 phil-wifi-base:1.11 pgoyette-compat-0625:1.11 netbsd-8-0-RC2:1.11 pgoyette-compat-0521:1.11 pgoyette-compat-0502:1.11 pgoyette-compat-0422:1.11 netbsd-8-0-RC1:1.11 pgoyette-compat-0415:1.11 pgoyette-compat-0407:1.11 pgoyette-compat-0330:1.11 pgoyette-compat-0322:1.11 pgoyette-compat-0315:1.11 netbsd-7-1-2-RELEASE:1.11 pgoyette-compat:1.11.0.66 pgoyette-compat-base:1.11 netbsd-7-1-1-RELEASE:1.11 matt-nb8-mediatek:1.11.0.64 matt-nb8-mediatek-base:1.11 perseant-stdc-iso10646:1.11.0.62 perseant-stdc-iso10646-base:1.11 netbsd-8:1.11.0.60 netbsd-8-base:1.11 prg-localcount2-base3:1.11 prg-localcount2-base2:1.11 prg-localcount2-base1:1.11 prg-localcount2:1.11.0.58 prg-localcount2-base:1.11 pgoyette-localcount-20170426:1.11 bouyer-socketcan-base1:1.11 pgoyette-localcount-20170320:1.11 netbsd-7-1:1.11.0.56 netbsd-7-1-RELEASE:1.11 netbsd-7-1-RC2:1.11 netbsd-7-nhusb-base-20170116:1.11 bouyer-socketcan:1.11.0.54 bouyer-socketcan-base:1.11 pgoyette-localcount-20170107:1.11 netbsd-7-1-RC1:1.11 pgoyette-localcount-20161104:1.11 netbsd-7-0-2-RELEASE:1.11 localcount-20160914:1.11 netbsd-7-nhusb:1.11.0.52 netbsd-7-nhusb-base:1.11 pgoyette-localcount-20160806:1.11 pgoyette-localcount-20160726:1.11 pgoyette-localcount:1.11.0.50 pgoyette-localcount-base:1.11 netbsd-7-0-1-RELEASE:1.11 netbsd-7-0:1.11.0.48 netbsd-7-0-RELEASE:1.11 netbsd-7-0-RC3:1.11 netbsd-7-0-RC2:1.11 netbsd-7-0-RC1:1.11 netbsd-5-2-3-RELEASE:1.11 netbsd-5-1-5-RELEASE:1.11 netbsd-6-0-6-RELEASE:1.11 netbsd-6-1-5-RELEASE:1.11 netbsd-7:1.11.0.46 netbsd-7-base:1.11 yamt-pagecache-base9:1.11 yamt-pagecache-tag8:1.11 netbsd-6-1-4-RELEASE:1.11 netbsd-6-0-5-RELEASE:1.11 tls-earlyentropy:1.11.0.44 tls-earlyentropy-base:1.11 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.11 riastradh-drm2-base3:1.11 netbsd-6-1-3-RELEASE:1.11 netbsd-6-0-4-RELEASE:1.11 netbsd-5-2-2-RELEASE:1.11 netbsd-5-1-4-RELEASE:1.11 netbsd-6-1-2-RELEASE:1.11 netbsd-6-0-3-RELEASE:1.11 netbsd-5-2-1-RELEASE:1.11 netbsd-5-1-3-RELEASE:1.11 netbsd-6-1-1-RELEASE:1.11 riastradh-drm2-base2:1.11 riastradh-drm2-base1:1.11 riastradh-drm2:1.11.0.38 riastradh-drm2-base:1.11 netbsd-6-1:1.11.0.42 netbsd-6-0-2-RELEASE:1.11 netbsd-6-1-RELEASE:1.11 netbsd-6-1-RC4:1.11 netbsd-6-1-RC3:1.11 agc-symver:1.11.0.40 agc-symver-base:1.11 netbsd-6-1-RC2:1.11 netbsd-6-1-RC1:1.11 yamt-pagecache-base8:1.11 netbsd-5-2:1.11.0.36 netbsd-6-0-1-RELEASE:1.11 yamt-pagecache-base7:1.11 netbsd-5-2-RELEASE:1.11 netbsd-5-2-RC1:1.11 matt-nb6-plus-nbase:1.11 yamt-pagecache-base6:1.11 netbsd-6-0:1.11.0.34 netbsd-6-0-RELEASE:1.11 netbsd-6-0-RC2:1.11 tls-maxphys:1.11.0.32 tls-maxphys-base:1.11 matt-nb6-plus:1.11.0.30 matt-nb6-plus-base:1.11 netbsd-6-0-RC1:1.11 yamt-pagecache-base5:1.11 yamt-pagecache-base4:1.11 netbsd-6:1.11.0.28 netbsd-6-base:1.11 netbsd-5-1-2-RELEASE:1.11 netbsd-5-1-1-RELEASE:1.11 yamt-pagecache-base3:1.11 yamt-pagecache-base2:1.11 yamt-pagecache:1.11.0.6 yamt-pagecache-base:1.11 cherry-xenmp:1.11.0.26 cherry-xenmp-base:1.11 uebayasi-xip-base7:1.11 bouyer-quota2-nbase:1.11 bouyer-quota2:1.11.0.24 bouyer-quota2-base:1.11 matt-mips64-premerge-20101231:1.11 matt-nb5-mips64-premerge-20101231:1.11 matt-nb5-pq3:1.11.0.22 matt-nb5-pq3-base:1.11 netbsd-5-1:1.11.0.20 uebayasi-xip-base6:1.11 uebayasi-xip-base5:1.11 netbsd-5-1-RELEASE:1.11 uebayasi-xip-base4:1.11 uebayasi-xip-base3:1.11 netbsd-5-1-RC4:1.11 matt-nb5-mips64-k15:1.11 uebayasi-xip-base2:1.11 netbsd-5-1-RC3:1.11 netbsd-5-1-RC2:1.11 uebayasi-xip-base1:1.11 netbsd-5-1-RC1:1.11 uebayasi-xip:1.11.0.18 uebayasi-xip-base:1.11 netbsd-5-0-2-RELEASE:1.11 matt-nb5-mips64-premerge-20091211:1.11 matt-premerge-20091211:1.11 matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.11 matt-nb4-mips64-k7-u2a-k9b:1.11 matt-nb5-mips64-u1-k1-k5:1.11 matt-nb5-mips64:1.11.0.16 netbsd-5-0-1-RELEASE:1.11 jym-xensuspend-nbase:1.11 netbsd-5-0:1.11.0.14 netbsd-5-0-RELEASE:1.11 netbsd-5-0-RC4:1.11 netbsd-5-0-RC3:1.11 netbsd-5-0-RC2:1.11 jym-xensuspend:1.11.0.12 jym-xensuspend-base:1.11 netbsd-5-0-RC1:1.11 christos-time_t-nbase:1.11 christos-time_t:1.11.0.10 christos-time_t-base:1.11 netbsd-5:1.11.0.8 netbsd-5-base:1.11 matt-mips64-base2:1.11 matt-mips64:1.7.0.20 netbsd-4-0-1-RELEASE:1.7 wrstuden-revivesa-base-3:1.11 wrstuden-revivesa-base-2:1.11 wrstuden-fixsa-newbase:1.7 wrstuden-revivesa-base-1:1.11 simonb-wapbl-nbase:1.11 yamt-pf42-base4:1.11 simonb-wapbl:1.11.0.4 simonb-wapbl-base:1.11 yamt-pf42-base3:1.11 hpcarm-cleanup-nbase:1.11 yamt-pf42-baseX:1.10 yamt-pf42-base2:1.11 wrstuden-revivesa:1.11.0.2 wrstuden-revivesa-base:1.11 yamt-pf42:1.10.0.6 yamt-pf42-base:1.10 keiichi-mipv6:1.10.0.4 keiichi-mipv6-base:1.10 matt-armv6-nbase:1.10 matt-armv6-prevmlocking:1.7 wrstuden-fixsa-base-1:1.7 netbsd-4-0:1.7.0.18 netbsd-4-0-RELEASE:1.7 cube-autoconf:1.10.0.2 cube-autoconf-base:1.10 netbsd-4-0-RC5:1.7 netbsd-4-0-RC4:1.7 netbsd-4-0-RC3:1.7 netbsd-4-0-RC2:1.7 netbsd-4-0-RC1:1.7 matt-armv6:1.7.0.16 matt-armv6-base:1.7 matt-mips64-base:1.7 hpcarm-cleanup:1.7.0.14 hpcarm-cleanup-base:1.10 netbsd-3-1-1-RELEASE:1.7 netbsd-3-0-3-RELEASE:1.7 wrstuden-fixsa:1.7.0.12 wrstuden-fixsa-base:1.7 abandoned-netbsd-4-base:1.7 abandoned-netbsd-4:1.7.0.6 netbsd-3-1:1.7.0.8 netbsd-3-1-RELEASE:1.7 netbsd-3-0-2-RELEASE:1.7 netbsd-3-1-RC4:1.7 netbsd-3-1-RC3:1.7 netbsd-3-1-RC2:1.7 netbsd-3-1-RC1:1.7 netbsd-4:1.7.0.10 netbsd-4-base:1.7 netbsd-3-0-1-RELEASE:1.7 netbsd-3-0:1.7.0.4 netbsd-3-0-RELEASE:1.7 netbsd-3-0-RC6:1.7 netbsd-3-0-RC5:1.7 netbsd-3-0-RC4:1.7 netbsd-3-0-RC3:1.7 netbsd-3-0-RC2:1.7 netbsd-3-0-RC1:1.7 netbsd-2-0-3-RELEASE:1.5.2.1 netbsd-2-1:1.5.2.1.0.4 netbsd-2-1-RELEASE:1.5.2.1 netbsd-2-1-RC6:1.5.2.1 netbsd-2-1-RC5:1.5.2.1 netbsd-2-1-RC4:1.5.2.1 netbsd-2-1-RC3:1.5.2.1 netbsd-2-1-RC2:1.5.2.1 netbsd-2-1-RC1:1.5.2.1 netbsd-2-0-2-RELEASE:1.5.2.1 netbsd-3:1.7.0.2 netbsd-3-base:1.7 netbsd-2-0-1-RELEASE:1.5.2.1 netbsd-2:1.5.2.1.0.2 netbsd-2-base:1.5.2.1 netbsd-2-0-RELEASE:1.5.2.1 netbsd-2-0-RC5:1.5.2.1 netbsd-2-0-RC4:1.5.2.1 netbsd-2-0-RC3:1.5.2.1 netbsd-2-0-RC2:1.5.2.1 netbsd-2-0-RC1:1.5.2.1 netbsd-2-0:1.5.0.2 netbsd-2-0-base:1.5 netbsd-1-6-PATCH002-RELEASE:1.4 netbsd-1-6-PATCH002:1.4 netbsd-1-6-PATCH002-RC4:1.4 netbsd-1-6-PATCH002-RC3:1.4 netbsd-1-6-PATCH002-RC2:1.4 netbsd-1-6-PATCH002-RC1:1.4 netbsd-1-6-PATCH001:1.4 netbsd-1-6-PATCH001-RELEASE:1.4 netbsd-1-6-PATCH001-RC3:1.4 netbsd-1-6-PATCH001-RC2:1.4 netbsd-1-6-PATCH001-RC1:1.4 nathanw_sa_before_merge:1.4 nathanw_sa_end:1.4 fvdl_fs64_base:1.4 nathanw_sa_base:1.4 netbsd-1-6-RELEASE:1.4 netbsd-1-6-RC3:1.4 netbsd-1-6-RC2:1.4 netbsd-1-6-RC1:1.4 netbsd-1-6:1.4.0.4 netbsd-1-6-base:1.4 netbsd-1-5-PATCH003:1.3 netbsd-1-5-PATCH002:1.3 netbsd-1-5-PATCH001:1.3 nathanw_sa:1.4.0.2 netbsd-1-5-RELEASE:1.3 netbsd-1-5-BETA2:1.3 netbsd-1-5-BETA:1.3 netbsd-1-5-ALPHA2:1.3 netbsd-1-5:1.3.0.4 netbsd-1-5-base:1.3 minoura-xpg4dl:1.3.0.2 minoura-xpg4dl-base:1.3; locks; strict; comment @ * @; 1.11 date 2008.04.28.20.22.54; author martin; state Exp; branches 1.11.10.1; next 1.10; 1.10 date 2007.11.08.20.29.35; author christos; state Exp; branches 1.10.6.1; next 1.9; 1.9 date 2007.11.07.09.03.58; author dogcow; state Exp; branches; next 1.8; 1.8 date 2007.11.06.19.21.18; author christos; state Exp; branches; next 1.7; 1.7 date 2005.02.03.04.39.32; author perry; state Exp; branches 1.7.16.1; next 1.6; 1.6 date 2004.06.20.22.20.14; author jmc; state Exp; branches; next 1.5; 1.5 date 2003.04.28.23.16.13; author bjh21; state Exp; branches 1.5.2.1; next 1.4; 1.4 date 2000.07.07.10.43.54; author ad; state Exp; branches; next 1.3; 1.3 date 2000.04.02.22.03.29; author christos; state Exp; branches; next 1.2; 1.2 date 2000.04.02.06.32.41; author christos; state Exp; branches; next 1.1; 1.1 date 2000.04.01.22.37.15; author christos; state Exp; branches; next ; 1.11.10.1 date 2008.04.28.20.22.54; author martin; state dead; branches; next 1.11.10.2; 1.11.10.2 date 2008.04.28.20.22.55; author martin; state Exp; branches; next ; 1.10.6.1 date 2008.05.18.12.30.09; author yamt; state Exp; branches; next ; 1.7.16.1 date 2008.01.09.01.33.04; author matt; state Exp; branches; next ; 1.5.2.1 date 2004.06.22.07.18.25; author tron; state Exp; branches; next ; desc @@ 1.11 log @Remove clause 3 and 4 from TNF licenses @ text @/* $NetBSD: getopt.h,v 1.10 2007/11/08 20:29:35 christos Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Dieter Baron and Thomas Klausner. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #ifndef _GETOPT_H_ #define _GETOPT_H_ #include #include /* * Gnu like getopt_long() and BSD4.4 getsubopt()/optreset extensions */ #define no_argument 0 #define required_argument 1 #define optional_argument 2 struct option { /* name of long option */ const char *name; /* * one of no_argument, required_argument, and optional_argument: * whether option takes an argument */ int has_arg; /* if not NULL, set *flag to val when option found */ int *flag; /* if flag not NULL, value to set *flag to; else return value */ int val; }; __BEGIN_DECLS int getopt_long(int, char * const *, const char *, const struct option *, int *); __END_DECLS #endif /* !_GETOPT_H_ */ @ 1.11.10.1 log @file getopt.h was added on branch christos-time_t on 2008-04-28 20:22:55 +0000 @ text @d1 64 @ 1.11.10.2 log @Remove clause 3 and 4 from TNF licenses @ text @a0 64 /* $NetBSD: getopt.h,v 1.11 2008/04/28 20:22:54 martin Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Dieter Baron and Thomas Klausner. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #ifndef _GETOPT_H_ #define _GETOPT_H_ #include #include /* * Gnu like getopt_long() and BSD4.4 getsubopt()/optreset extensions */ #define no_argument 0 #define required_argument 1 #define optional_argument 2 struct option { /* name of long option */ const char *name; /* * one of no_argument, required_argument, and optional_argument: * whether option takes an argument */ int has_arg; /* if not NULL, set *flag to val when option found */ int *flag; /* if flag not NULL, value to set *flag to; else return value */ int val; }; __BEGIN_DECLS int getopt_long(int, char * const *, const char *, const struct option *, int *); __END_DECLS #endif /* !_GETOPT_H_ */ @ 1.10 log @revert the reversion of the previous change. Kill _NETBSD_SOURCE again. @ text @d1 1 a1 1 /* $NetBSD: getopt.h,v 1.9 2007/11/07 09:03:58 dogcow Exp $ */ a17 7 * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the NetBSD * Foundation, Inc. and its contributors. * 4. Neither the name of The NetBSD Foundation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. @ 1.10.6.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: getopt.h,v 1.10 2007/11/08 20:29:35 christos Exp $ */ d18 7 @ 1.9 log @Revert the other part of the getopt_long changes to fix non-NetBSD builds; viz -r1.22 -r1.23 src/lib/libc/stdlib/getopt_long.c @ text @d1 1 a1 1 /* $NetBSD: getopt.h,v 1.7 2005/02/03 04:39:32 perry Exp $ */ a42 1 #include a47 1 #if defined(_NETBSD_SOURCE) || defined(HAVE_NBTOOL_CONFIG_H) a64 1 #endif a65 1 #if defined(_NETBSD_SOURCE) a69 1 #endif @ 1.8 log @remove featuretest.h and NETBSD_SOURCE conditional ifdefs. This is not a standard header and does not have namespace issues. @ text @d43 1 d49 1 d67 1 d69 1 d74 1 @ 1.7 log @de-__P -- the hack is long since useless. Discussed with christos, matt, kleink, others. Approved by christos. @ text @d1 1 a1 1 /* $NetBSD: getopt.h,v 1.6 2004/06/20 22:20:14 jmc Exp $ */ a42 1 #include a47 1 #if defined(_NETBSD_SOURCE) || defined(HAVE_NBTOOL_CONFIG_H) a64 1 #endif a65 1 #if defined(_NETBSD_SOURCE) a69 1 #endif @ 1.7.16.1 log @sync with HEAD @ text @d1 1 a1 1 /* $NetBSD$ */ d43 1 d49 1 d67 1 d69 1 d74 1 @ 1.6 log @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 @ text @d1 1 a1 1 /* $NetBSD: getopt.h,v 1.5 2003/04/28 23:16:13 bjh21 Exp $ */ d71 2 a72 2 int getopt_long __P((int, char * const *, const char *, const struct option *, int *)); @ 1.5 log @Add a new feature-test macro, _NETBSD_SOURCE. If this is defined by the application, all NetBSD interfaces are made visible, even if some other feature-test macro (like _POSIX_C_SOURCE) is defined. defined _NETBSD_SOURCE if none of _ANSI_SOURCE, _POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve existing behaviour. This has two major advantages: + Programs that require non-POSIX facilities but define _POSIX_C_SOURCE can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS. + It makes most of the #ifs simpler, in that they're all now ORs of the various macros, rather than having checks for (!defined(_ANSI_SOURCE) || !defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place. I've tried not to change the semantics of the headers in any case where _NETBSD_SOURCE wasn't defined, but there were some places where the current semantics were clearly mad, and retaining them was harder than correcting them. In particular, I've mostly normalised things so that _ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE, _XOPEN_SOURCE and _NETBSD_SOURCE in that order. Tested by building for vax, encouraged by thorpej, and uncontested in tech-userlevel for a week. @ text @d1 1 a1 1 /* $NetBSD: getopt.h,v 1.4 2000/07/07 10:43:54 ad Exp $ */ d49 1 a49 1 #if defined(_NETBSD_SOURCE) d67 1 d69 1 @ 1.5.2.1 log @Pull up revision 1.6 (requested by jmc in ticket #527): 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 @ text @d1 1 a1 1 /* $NetBSD$ */ d49 1 a49 1 #if defined(_NETBSD_SOURCE) || defined(HAVE_NBTOOL_CONFIG_H) a66 1 #endif a67 1 #if defined(_NETBSD_SOURCE) @ 1.4 log @Pull in , since we're using __BEGIN_DECLS/__END_DECLS. @ text @d1 1 a1 1 /* $NetBSD: getopt.h,v 1.3 2000/04/02 22:03:29 christos Exp $ */ d43 1 d49 1 a49 1 #if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE) @ 1.3 log @Include to get the rest of the getopt goo. @ text @d1 1 a1 1 /* $NetBSD: getopt.h,v 1.2 2000/04/02 06:32:41 christos Exp $ */ d38 1 d42 1 d44 1 @ 1.2 log @backout previous. the definition of struct option caused too many namespace collisions. Instead, define getopt_long in getopt.h and getopt in unistd.h where it belongs. @ text @d1 1 a1 1 /* $NetBSD: getopt.h,v 1.1 2000/04/01 22:37:15 christos Exp $ */ d41 1 @ 1.1 log @Add getopt.h and collect all the getopt related stuff here. Make unistd.h include to get the getopt stuff. This adds support for getopt_long from Dieter Baron and Thomas Klausner. @ text @d1 1 a1 1 /* $NetBSD$ */ a40 17 #include /* * IEEE Std 1003.2-92, adopted in X/Open Portability Guide Issue 4 and later */ #if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || \ (_POSIX_C_SOURCE - 0) >= 2 || (_XOPEN_SOURCE - 0) >= 4 __BEGIN_DECLS extern int opterr; /* if error messages should be printed */ extern int optind; /* index into parent argv vector */ extern int optopt; /* last invalid option letter */ extern char *optarg; /* argument associated with option */ int getopt __P((int, char * const *, const char *)); __END_DECLS #endif a65 4 extern int optreset; /* reset getopt */ extern char *suboptarg; /* getsubopt(3) external variable */ int getsubopt __P((char **, char * const *, char **)); @