summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmdutils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmdutils.c b/cmdutils.c
index 8e43795191..062d7ec2f8 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -182,7 +182,10 @@ static const OptionDef *find_option(const OptionDef *po, const char *name)
return po;
}
-#if HAVE_COMMANDLINETOARGVW
+/* _WIN32 means using the windows libc - cygwin doesn't define that
+ * by default. HAVE_COMMANDLINETOARGVW is true on cygwin, while
+ * it doesn't provide the actual command line via GetCommandLineW(). */
+#if HAVE_COMMANDLINETOARGVW && defined(_WIN32)
#include <windows.h>
#include <shellapi.h>
/* Will be leaked on exit */