From: Niels Möller Date: Fri, 5 Aug 2022 19:18:53 +0000 (+0200) Subject: Fix to getopt.c includes. X-Git-Tag: nettle_3.9_release_20230514~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4ec224a9903f89bd45b5a3563df502c885d8bf6;p=thirdparty%2Fnettle.git Fix to getopt.c includes. * getopt.c: Include stdlib.h and unistd.h unconditionally, similarly to the gnulib version of this file. --- diff --git a/ChangeLog b/ChangeLog index 99fb72f2..0416b59c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2022-08-05 Niels Möller + + * getopt.c: Include stdlib.h and unistd.h unconditionally, + similarly to the gnulib version of this file. + 2022-08-04 Niels Möller From Brad Smith: diff --git a/getopt.c b/getopt.c index 6be0aafa..9d29de7c 100644 --- a/getopt.c +++ b/getopt.c @@ -30,6 +30,10 @@ #endif #include +#include +#include +#include + /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C @@ -50,17 +54,6 @@ #ifndef ELIDE_CODE -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#ifdef __GNU_LIBRARY__ -/* Don't include stdlib.h for non-GNU C libraries because some of them - contain conflicting prototypes for getopt. */ -# include -# include -#endif /* GNU C library. */ - -#include - #ifdef VMS # include #endif