From caa86c6d8d7030e504add365a3a46fbc34b911df Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 12 Mar 2011 20:55:47 +0100 Subject: getopt.c, getopt.h: avoid the need for __FORCE_GLIBC Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/bits/getopt.h | 2 +- libc/unistd/getopt.c | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/libc/sysdeps/linux/common/bits/getopt.h b/libc/sysdeps/linux/common/bits/getopt.h index 89bd33238..7edb7bb44 100644 --- a/libc/sysdeps/linux/common/bits/getopt.h +++ b/libc/sysdeps/linux/common/bits/getopt.h @@ -33,7 +33,7 @@ not defined, include , which will pull in for us 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.) */ -#if !defined __GNU_LIBRARY__ +#if !defined __GNU_LIBRARY__ && !defined __UCLIBC__ # include #endif diff --git a/libc/unistd/getopt.c b/libc/unistd/getopt.c index f4c113092..f1ee0f462 100644 --- a/libc/unistd/getopt.c +++ b/libc/unistd/getopt.c @@ -36,9 +36,6 @@ # include #endif -#define __FORCE_GLIBC -#include - #include /* 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 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 contain conflicting prototypes for getopt. */ # include @@ -161,7 +158,7 @@ int optopt = '?'; static struct _getopt_data getopt_data; -#ifndef __GNU_LIBRARY__ +#if !defined __GNU_LIBRARY__ && !defined __UCLIBC__ /* Avoid depending on library functions or files whose names are inconsistent. */ -- cgit v1.2.3