[09/17] msvc: mark a variable as non-const
diff mbox series

Message ID e813075ade89380848bc7a9cb711cb52642ae4d5.1560860634.git.gitgitgadget@gmail.com
State New
Headers show
Series
  • Fix MSVC support, at long last
Related show

Commit Message

Philippe Blain via GitGitGadget June 18, 2019, 12:24 p.m. UTC
From: Jeff Hostetler <jeffhost@microsoft.com>

VS2015 complains when using a const pointer in memcpy()/free().

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 compat/mingw.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/compat/mingw.c b/compat/mingw.c
index 0d8713e515..d14d33308d 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -1553,7 +1553,10 @@  static int try_shell_exec(const char *cmd, char *const *argv)
 	if (prog) {
 		int exec_id;
 		int argc = 0;
-		const char **argv2;
+#ifndef _MSC_VER
+		const
+#endif
+		char **argv2;
 		while (argv[argc]) argc++;
 		ALLOC_ARRAY(argv2, argc + 1);
 		argv2[0] = (char *)cmd;	/* full path to the script file */