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/trunk@5338 4407c894-4637-0410-b4f5-ada5f102cad1
diff --git a/mingw-w64-headers/crt/ChangeLog b/mingw-w64-headers/crt/ChangeLog index 548f5fc..ad2a403 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-08-04 Kai Tietz <ktietz@redhat.com> * crtdbg.h: disable prototyping of C++ new/delete operators.
diff --git a/mingw-w64-headers/crt/getopt.h b/mingw-w64-headers/crt/getopt.h index 76267b1..0dbfe35 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__