getopt.h (optreset): Define as __mingw_optreset regardless of
_BSD_SOURCE being defined. (bug #3554856.)
git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/stable/v2.x@5340 4407c894-4637-0410-b4f5-ada5f102cad1
diff --git a/mingw-w64-crt/revstamp.h b/mingw-w64-crt/revstamp.h
index 8bebaf1..6b6636e 100644
--- a/mingw-w64-crt/revstamp.h
+++ b/mingw-w64-crt/revstamp.h
@@ -1,4 +1,4 @@
/* Do not edit. Autogenerated. */
-#define __MINGW_W64_REV "5336"
+#define __MINGW_W64_REV "5340"
#define __MINGW_W64_REV_STAMP "2012-08-07"
diff --git a/mingw-w64-headers/crt/ChangeLog b/mingw-w64-headers/crt/ChangeLog
index 1b6ce84..355dbb2 100644
--- a/mingw-w64-headers/crt/ChangeLog
+++ b/mingw-w64-headers/crt/ChangeLog
@@ -1,3 +1,8 @@
+2012-08-07 Ozkan Sezer <sezeroz@gmail.com>
+
+ * getopt.h (optreset): Define as __mingw_optreset regardless of
+ _BSD_SOURCE being defined. (bug #3554856.)
+
2012-07-04 Ozkan Sezer <sezeroz@gmail.com>
* _mingw.h.in (__MINGW_GCC_VERSION): New macro.
diff --git a/mingw-w64-headers/crt/getopt.h b/mingw-w64-headers/crt/getopt.h
index 924df0b..0883815 100644
--- a/mingw-w64-headers/crt/getopt.h
+++ b/mingw-w64-headers/crt/getopt.h
@@ -28,6 +28,7 @@
extern int getopt(int nargc, char * const *nargv, const char *options);
+#define optreset __mingw_optreset
#ifdef _BSD_SOURCE
/*
* BSD adds the non-standard `optreset' feature, for reinitialisation
@@ -35,8 +36,6 @@
* proclaim their BSD heritage, before including this header; however,
* to maintain portability, developers are advised to avoid it.
*/
-# define optreset __mingw_optreset
-
extern int optreset;
#endif
#ifdef __cplusplus
@@ -52,6 +51,7 @@
* to declare the extended API.
*/
#endif /* !defined(__GETOPT_H__) */
+
#if !defined(__UNISTD_H_SOURCED__) && !defined(__GETOPT_LONG_H__)
#define __GETOPT_LONG_H__