--- getopt.h	2012-02-21 18:56:58.061637000 -0500
+++ ../../../test/texk/kpathsea//getopt.h	2012-02-26 11:52:04.247503600 -0500
@@ -112,6 +112,11 @@
 #define required_argument       1
 #define optional_argument       2
 
+#if defined (__CYGWIN__) && !defined ( __GETOPT_H__)
+#define __GETOPT_H__
+extern KPSEDLL int getopt (int argc, char *const *argv, const char *shortopts);
+#endif
+
 #if defined (__STDC__) && __STDC__
 #ifdef __GNU_LIBRARY__
 /* Many other libraries have conflicting prototypes for getopt, with
@@ -119,9 +124,9 @@
    errors, only prototype getopt for the GNU C library.  */
 extern KPSEDLL int getopt (int argc, char *const *argv, const char *shortopts);
 #else /* not __GNU_LIBRARY__ */
-#ifndef __cplusplus
+#if !defined (__cplusplus) && !defined (__CYGWIN__)
 extern KPSEDLL int getopt ();
-#endif /* not __cplusplus */
+#endif /* not __cplusplus and not __CYGWIN__ */
 #endif /* __GNU_LIBRARY__ */
 extern KPSEDLL int getopt_long (int argc, char *const *argv, const char *shortopts,
                         const struct option *longopts, int *longind);
