This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] No getopt declarations under cygwin


This has been sitting around in my sandbox for a while...

cgf

2002-12-28  Christopher Faylor  <cgf@redhat.com>

	* libc/include/sys/unistd.h: Under cygwin, just include getopt.h rather
	than defining getopt directly.

Index: libc/include/sys/unistd.h
===================================================================
RCS file: /cvs/uberbaum/newlib/libc/include/sys/unistd.h,v
retrieving revision 1.36
diff -u -p -r1.36 unistd.h
--- libc/include/sys/unistd.h	18 Aug 2002 06:08:39 -0000	1.36
+++ libc/include/sys/unistd.h	28 Dec 2002 23:18:14 -0000
@@ -120,10 +120,14 @@ int     _EXFUN(unlink, (const char *__pa
 int     _EXFUN(vhangup, (void ));
 _READ_WRITE_RETURN_TYPE _EXFUN(write, (int __fd, const void *__buf, size_t __nbyte ));
 
+#ifdef __CYGWIN__
+# include <getopt.h>
+#else
 extern char *optarg;			/* getopt(3) external variables */
 extern int optind, opterr, optopt;
 int	 getopt(int, char * const [], const char *);
 extern int optreset;			/* getopt(3) external variable */
+#endif
 
 #ifndef        _POSIX_SOURCE
 pid_t   _EXFUN(vfork, (void ));


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]