Browse Source

getopt.c, getopt.h: avoid the need for __FORCE_GLIBC

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Peter S. Mazinger 13 years ago
parent
commit
caa86c6d8d
2 changed files with 3 additions and 6 deletions
  1. 1 1
      libc/sysdeps/linux/common/bits/getopt.h
  2. 2 5
      libc/unistd/getopt.c

+ 1 - 1
libc/sysdeps/linux/common/bits/getopt.h

@@ -33,7 +33,7 @@
    not defined, include <ctype.h>, which will pull in <features.h> for us
    not defined, include <ctype.h>, which will pull in <features.h> for us
    if it's from glibc.  (Why ctype.h?  It's guaranteed to exist and it
    if it's from glibc.  (Why ctype.h?  It's guaranteed to exist and it
    doesn't flood the namespace with stuff the way some other headers do.)  */
    doesn't flood the namespace with stuff the way some other headers do.)  */
-#if !defined __GNU_LIBRARY__
+#if !defined __GNU_LIBRARY__ && !defined __UCLIBC__
 # include <ctype.h>
 # include <ctype.h>
 #endif
 #endif
 
 

+ 2 - 5
libc/unistd/getopt.c

@@ -36,9 +36,6 @@
 # include <config.h>
 # include <config.h>
 #endif
 #endif
 
 
-#define __FORCE_GLIBC
-#include <features.h>
-
 #include <stdio.h>
 #include <stdio.h>
 
 
 /* Comment out all this code if we are using the GNU C Library, and are not
 /* Comment out all this code if we are using the GNU C Library, and are not
@@ -62,7 +59,7 @@
 
 
 /* This needs to come after some library #include
 /* This needs to come after some library #include
    to get __GNU_LIBRARY__ defined.  */
    to get __GNU_LIBRARY__ defined.  */
-#ifdef	__GNU_LIBRARY__
+#if defined __GNU_LIBRARY__ || defined __UCLIBC__
 /* Don't include stdlib.h for non-GNU C libraries because some of them
 /* Don't include stdlib.h for non-GNU C libraries because some of them
    contain conflicting prototypes for getopt.  */
    contain conflicting prototypes for getopt.  */
 # include <stdlib.h>
 # include <stdlib.h>
@@ -161,7 +158,7 @@ int optopt = '?';
 static struct _getopt_data getopt_data;
 static struct _getopt_data getopt_data;
 
 
 
 
-#ifndef __GNU_LIBRARY__
+#if !defined __GNU_LIBRARY__ && !defined __UCLIBC__
 
 
 /* Avoid depending on library functions or files
 /* Avoid depending on library functions or files
    whose names are inconsistent.  */
    whose names are inconsistent.  */