From dae6303135c66acdd0e4f3985c6e5c95334aea7f Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 30 Sep 2013 08:28:58 +0000 Subject: Fix getopt header confusion. Our copy of getopt.h in lib/win32 was beating the system getopt.h in the search path, and providing different definitions, which clang picked up. Renamed our getopt.h to bsd_getopt.h, and added a box_getopt.h to decide whether to include this one instead of the system getopt.h. --- lib/win32/box_getopt.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 lib/win32/box_getopt.h (limited to 'lib/win32/box_getopt.h') diff --git a/lib/win32/box_getopt.h b/lib/win32/box_getopt.h new file mode 100644 index 00000000..f18446d4 --- /dev/null +++ b/lib/win32/box_getopt.h @@ -0,0 +1,14 @@ +#if defined _MSC_VER || defined __MINGW32__ +#define REPLACE_GETOPT 1 /* use this getopt as the system getopt(3) */ +#else +#define REPLACE_GETOPT 0 // force a conflict if included multiple times +#endif + +#if REPLACE_GETOPT +# include "bsd_getopt.h" +# define BOX_BSD_GETOPT +#else +# include +# undef BOX_BSD_GETOPT +#endif + -- cgit v1.2.3