Browse Source

as psm points out, we need to use bits/getopt.h in unistd.h since getopt.h wont exist if user disables the option

Mike Frysinger 18 years ago
parent
commit
afa5bf6803
3 changed files with 3 additions and 2 deletions
  1. 0 1
      include/getopt.h
  2. 1 1
      include/unistd.h
  3. 2 0
      libc/sysdeps/linux/common/bits/getopt.h

+ 0 - 1
include/getopt.h

@@ -1,5 +1,4 @@
 /* This file will not be installed if not using gnu getopt. */
 
-#include <features.h>
 #include <bits/getopt.h>
 

+ 1 - 1
include/unistd.h

@@ -782,7 +782,7 @@ extern int setlogin (__const char *__name) __THROW __nonnull ((1));
    arguments in ARGV (ARGC of them, minus the program name) for
    options given in OPTS.  */
 # define __need_getopt
-# include <getopt.h>
+# include <bits/getopt.h>
 #endif
 
 

+ 2 - 0
libc/sysdeps/linux/common/bits/getopt.h

@@ -20,6 +20,8 @@
 
 #ifndef _GETOPT_H
 
+#include <features.h>
+
 #ifndef __need_getopt
 # define _GETOPT_H 1
 #endif