]> Savannah Git Hosting - gnulib.git/commit
getopt: clean up getopt.c and getopt1.c file headers
authorZack Weinberg <zackw@panix.com>
Thu, 6 Apr 2017 18:14:13 +0000 (11:14 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 6 Apr 2017 22:42:03 +0000 (15:42 -0700)
commitfbd6c988447f5793e08019e59f4789db892af698
tree1702a4e1c7e770644d153622848542829d06e6c3
parent2dcee3a7916d833622476ddd464a549db9907f1b
getopt: clean up getopt.c and getopt1.c file headers

In getopt.c, there is no need to include wchar.h at all, and it is
safe nowadays to assume that stdlib.h does declare getenv (several
other gnulib modules make this assumption).

In getopt1.c, the #ifdef _LIBC block at the top can be simplified
by using "" inclusions consistently, and there is no actual need to
include stdlib.h (except in the #ifdef TEST block, where it should be
unconditional), nor to provide a backup definition of NULL at all.

* lib/getopt1.c: Simplify #ifdeffage at top of file.
Move inclusion of stdlib.h to #ifdef TEST block and make
unconditional.  Do not define NULL.
* lib/getopt.c: Don't include wchar.h. No need to declare getenv.
* m4/getopt.m4 (gl_PREREQ_GETENV): Delete.
* modules/getopt-gnu, modules/getopt-posix: Don't call
gl_PREREQ_GETENV.
ChangeLog
lib/getopt.c
lib/getopt1.c
m4/getopt.m4
modules/getopt-gnu
modules/getopt-posix