diff options
author | Keith Marshall <keithmarshall@@users.sf.net> | 2009-01-04 17:35:36 +0000 |
---|---|---|
committer | Keith Marshall <keithmarshall@@users.sf.net> | 2009-01-04 17:35:36 +0000 |
commit | f1170e02f2463a0a296f9d3199bb7e6e8257d2ab (patch) | |
tree | 49a26f5f696a935035d66994bb44cbc825c5fee5 /winsup/mingw/include/getopt.h | |
parent | 952783ba77512e36857a6179da8cada9367ef3cc (diff) | |
download | cygnal-f1170e02f2463a0a296f9d3199bb7e6e8257d2ab.tar.gz cygnal-f1170e02f2463a0a296f9d3199bb7e6e8257d2ab.tar.bz2 cygnal-f1170e02f2463a0a296f9d3199bb7e6e8257d2ab.zip |
Fix MinGW-Bug [2445962]; (reported by Keishi Suenaga).
Diffstat (limited to 'winsup/mingw/include/getopt.h')
-rw-r--r-- | winsup/mingw/include/getopt.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/winsup/mingw/include/getopt.h b/winsup/mingw/include/getopt.h index 00cd5473f..a57d3f0de 100644 --- a/winsup/mingw/include/getopt.h +++ b/winsup/mingw/include/getopt.h @@ -45,6 +45,17 @@ extern char *optarg; /* pointer to argument of current option */ extern int getopt( int, char * const [], const char * ); +#ifdef _BSD_SOURCE +/* + * BSD adds the non-standard `optreset' feature, for reinitialisation + * of `getopt' parsing. We support this feature, for applications which + * 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 } #endif |