From c062dbe9da9037fd7059d0c3801d91a1f1e8a12d Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 30 Nov 2017 22:27:42 +0000 Subject: [PATCH] Only replace getopt on Windows, not any other platform The preprocessor test was wrong, causing this code to be built (and potentially replace the system getopt/long) on all platforms. This made it impossible to build with -Werror=writable-strings on Unix without modifying this file further to fix its casting of static strings to mutable pointers. --- lib/win32/getopt_long.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/win32/getopt_long.cpp b/lib/win32/getopt_long.cpp index f1f026859..0daead22f 100755 --- a/lib/win32/getopt_long.cpp +++ b/lib/win32/getopt_long.cpp @@ -68,7 +68,7 @@ #include "box_getopt.h" -#ifdef REPLACE_GETOPT // until end of file +#if REPLACE_GETOPT // until end of file int opterr = 1; /* if error message should be printed */ int optind = 1; /* index into parent argv vector */