]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Fix to getopt.c includes.
authorNiels Möller <nisse@lysator.liu.se>
Fri, 5 Aug 2022 19:18:53 +0000 (21:18 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Fri, 5 Aug 2022 19:18:53 +0000 (21:18 +0200)
* getopt.c: Include stdlib.h and unistd.h unconditionally,
similarly to the gnulib version of this file.

ChangeLog
getopt.c

index 99fb72f244b0ee4e638e3bec28ea931a9f0a5939..0416b59c082aca1374b52cace1172bb1acfe977f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2022-08-05  Niels Möller  <nisse@lysator.liu.se>
+
+       * getopt.c: Include stdlib.h and unistd.h unconditionally,
+       similarly to the gnulib version of this file.
+
 2022-08-04  Niels Möller  <nisse@lysator.liu.se>
 
        From Brad Smith:
index 6be0aafa2801c1540215467f5d8eb8e29950f55f..9d29de7c5ab1060864e94f5d7f447b0c25672d3d 100644 (file)
--- a/getopt.c
+++ b/getopt.c
 #endif
 
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
 
 /* 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
 #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 <stdlib.h>
-# include <unistd.h>
-#endif /* GNU C library.  */
-
-#include <string.h>
-
 #ifdef VMS
 # include <unixlib.h>
 #endif