From 380395d094b49834c3ec804407853fd6e81de702 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Thu, 2 May 2013 20:26:08 +0100 Subject: mingw: rename WIN32 cpp macro to GIT_WINDOWS_NATIVE Throughout git, it is assumed that the WIN32 preprocessor symbol is defined on native Windows setups (mingw and msvc) and not on Cygwin. On Cygwin, most of the time git can pretend this is just another Unix machine, and Windows-specific magic is generally counterproductive. Unfortunately Cygwin *does* define the WIN32 symbol in some headers. Best to rely on a new git-specific symbol GIT_WINDOWS_NATIVE instead, defined as follows: #if defined(WIN32) && !defined(__CYGWIN__) # define GIT_WINDOWS_NATIVE #endif After this change, it should be possible to drop the CYGWIN_V15_WIN32API setting without any negative effect. [rj: %s/WINDOWS_NATIVE/GIT_WINDOWS_NATIVE/g ] Signed-off-by: Jonathan Nieder Signed-off-by: Ramsay Jones Signed-off-by: Junio C Hamano --- run-command.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'run-command.c') diff --git a/run-command.c b/run-command.c index 1b32a12a29..aece872e33 100644 --- a/run-command.c +++ b/run-command.c @@ -72,7 +72,7 @@ static inline void close_pair(int fd[2]) close(fd[1]); } -#ifndef WIN32 +#ifndef GIT_WINDOWS_NATIVE static inline void dup_devnull(int to) { int fd = open("/dev/null", O_RDWR); @@ -159,7 +159,7 @@ static const char **prepare_shell_cmd(const char **argv) die("BUG: shell command is empty"); if (strcspn(argv[0], "|&;<>()$`\\\"' \t\n*?[#~=%") != strlen(argv[0])) { -#ifndef WIN32 +#ifndef GIT_WINDOWS_NATIVE nargv[nargc++] = SHELL_PATH; #else nargv[nargc++] = "sh"; @@ -182,7 +182,7 @@ static const char **prepare_shell_cmd(const char **argv) return nargv; } -#ifndef WIN32 +#ifndef GIT_WINDOWS_NATIVE static int execv_shell_cmd(const char **argv) { const char **nargv = prepare_shell_cmd(argv); @@ -193,7 +193,7 @@ static int execv_shell_cmd(const char **argv) } #endif -#ifndef WIN32 +#ifndef GIT_WINDOWS_NATIVE static int child_err = 2; static int child_notifier = -1; @@ -334,7 +334,7 @@ fail_pipe: trace_argv_printf(cmd->argv, "trace: run_command:"); fflush(NULL); -#ifndef WIN32 +#ifndef GIT_WINDOWS_NATIVE { int notify_pipe[2]; if (pipe(notify_pipe)) -- cgit v1.2.1