This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
[PATCH] avoid including getopt.h twice for cygwin
- From: Christopher Faylor <cgf at redhat dot com>
- To: newlib at sources dot redhat dot com
- Date: Fri, 7 Mar 2003 23:58:57 -0500
- Subject: [PATCH] avoid including getopt.h twice for cygwin
- Reply-to: newlib at sourceware dot org
2003-03-07 Christopher Faylor <cgf at redhat dot com>
* libc/include/sys/unistd.h: Guard getopt.h call to force only
declaration of getopt and avoid getopt_long declaration.
* libc/sys/cygwin/include/unistd.h: Remove.
Index: libc/include/sys/unistd.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/sys/unistd.h,v
retrieving revision 1.39
diff -u -p -r1.39 unistd.h
--- libc/include/sys/unistd.h 24 Jan 2003 15:25:24 -0000 1.39
+++ libc/include/sys/unistd.h 8 Mar 2003 04:56:30 -0000
@@ -126,7 +126,9 @@ int _EXFUN(vhangup, (void ));
_READ_WRITE_RETURN_TYPE _EXFUN(write, (int __fd, const void *__buf, size_t __nbyte ));
#ifdef __CYGWIN__
+# define __UNISTD_GETOPT__
# include <getopt.h>
+# undef __UNISTD_GETOPT__
#else
extern char *optarg; /* getopt(3) external variables */
extern int optind, opterr, optopt;