From 10a33cf8b403e3c031c5dd10a06b4a2a6489e48c Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Sat, 25 Mar 2017 11:24:24 -0400 Subject: getopt: eliminate __need_getopt by splitting up getopt.h. __need_getopt is misnamed; what it really means is "we want only the getopt features specified in POSIX, not the GNU extensions". Because this code is shared with gnulib, it winds up being cleanest to split getopt.h into *four* headers. getopt_core.h and getopt_ext.h will be shared with gnulib, getopt_posix.h will be just for glibc, and each project will have its own copy of getopt.h. * posix/bits/getopt_core.h, posix/bits/getopt_ext.h: New files, intended to be shared with gnulib. * posix/bits/getopt_posix.h: New file, not intended to be shared with gnulib. * posix/getopt.h: Now just includes features.h, bits/getopt_core.h, and bits/getopt_ext.h. Will no longer be shared with gnulib. * include/bits/getopt_core.h, include/bits/getopt_ext.h * include/bits/getopt_posix.h: New wrappers. * posix/Makefile: Install new headers. * posix/unistd.h, libio/stdio.h: Include bits/getopt_posix.h instead of getopt.h. --- posix/unistd.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'posix/unistd.h') diff --git a/posix/unistd.h b/posix/unistd.h index fa2492e..32b0f48 100644 --- a/posix/unistd.h +++ b/posix/unistd.h @@ -869,8 +869,7 @@ extern int setlogin (const char *__name) __THROW __nonnull ((1)); /* Get definitions and prototypes for functions to process the arguments in ARGV (ARGC of them, minus the program name) for options given in OPTS. */ -# define __need_getopt -# include +# include #endif -- cgit v1.1