diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2008-03-07 18:16:35 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2008-03-07 18:16:35 +0000 |
commit | c622842865283fd7b684683b1f12a6ab1519b09b (patch) | |
tree | 16eb24e8ff8dc0d12bae5ad4e9582cde361ed3b5 /newlib/libc/stdlib/getopt.c | |
parent | 0382d26727416adf62287dfc0ce66aa9a38db95b (diff) | |
download | cygnal-c622842865283fd7b684683b1f12a6ab1519b09b.tar.gz cygnal-c622842865283fd7b684683b1f12a6ab1519b09b.tar.bz2 cygnal-c622842865283fd7b684683b1f12a6ab1519b09b.zip |
2008-03-07 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/getopt.h: Hide newlib extensions under
the __need_getopt_newlib flag.
* libc/stdlib/getopt.c: #define __need_getopt_newlib before including
getopt.h. Put entire code under !HAVE_GETOPT to support platforms
with their own getopt implementation.
* configure.host: Specify HAVE_GETOPT for x86-linux.
Diffstat (limited to 'newlib/libc/stdlib/getopt.c')
-rw-r--r-- | newlib/libc/stdlib/getopt.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/newlib/libc/stdlib/getopt.c b/newlib/libc/stdlib/getopt.c index eb0a08284..944214d5f 100644 --- a/newlib/libc/stdlib/getopt.c +++ b/newlib/libc/stdlib/getopt.c @@ -83,11 +83,13 @@ Gregory Pietsch's current e-mail address: gpietsch@comcast.net ****************************************************************************/ +#ifndef HAVE_GETOPT /* include files */ #include <stdio.h> #include <stdlib.h> #include <string.h> +#define __need_getopt_newlib #include <getopt.h> /* macros */ @@ -472,4 +474,6 @@ __getopt_long_only_r (int argc, char *const argv[], const char *shortopts, return getopt_internal (argc, argv, shortopts, longopts, longind, 1, data); } +#endif /* !HAVE_GETOPT */ + /* end of file GETOPT.C */ |