From: Danny S. <dan...@cl...> - 2003-03-02 08:22:55
|
The NetBSD getopt which is in the the cygwin distro compiles and tests okay (using the libiberty testcase) with the following simple modifcation to getopt.c *** getopt.c Wed Nov 07 11:47:23 2001 --- getopt.c.mingw Sun Mar 02 07:54:47 2003 *************** *** 36,42 **** --- 36,46 ---- * POSSIBILITY OF SUCH DAMAGE. */ + #ifndef __MINGW32__ #include <sys/cdefs.h> + #else + #define __P(protos) protos /* full-blown ANSI C */ + #endif /*#include "namespace.h"*/ There are (IMO) obvious advantages to sharing code with cygwin. I have not tested yet with gcc or binutils builds, but if no problems are there any objections to putting this getopt into libmingwex.a and the header getopt.h into mingw's include. The header may need to be guarded with #if defined __MINGW32__ && !defined __NO_ISOCEXT The __P(protos) definition could instead go into _mingw.h. Danny |