From: Marius Storm-Olsen <mstormo@gmail.com>
To: Johannes.Schindelin@gmx.de
Cc: msysgit@googlegroups.com, git@vger.kernel.org, lznuaa@gmail.com,
Marius Storm-Olsen <mstormo@gmail.com>
Subject: [PATCH 08/17] Test for WIN32 instead of __MINGW32_
Date: Mon, 14 Sep 2009 15:11:21 +0200 [thread overview]
Message-ID: <8da5dcea21ce49b3a57fd224c088785a9f98e867.1252925290.git.mstormo@gmail.com> (raw)
In-Reply-To: <1d699897d4163224ce22db9400569fab20547e9d.1252925290.git.mstormo@gmail.com>
In-Reply-To: <cover.1252925290.git.mstormo@gmail.com>
From: Frank Li <lznuaa@gmail.com>
The code which is conditional on MinGW32 is actually conditional on Windows.
Use the WIN32 symbol, which is defined by the MINGW32 and MSVC environments,
but not by Cygwin.
Signed-off-by: Frank Li <lznuaa@gmail.com>
Signed-off-by: Marius Storm-Olsen <mstormo@gmail.com>
---
help.c | 2 +-
| 4 ++--
run-command.c | 8 ++++----
run-command.h | 2 +-
setup.c | 2 +-
5 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/help.c b/help.c
index fd51b8e..e8db31f 100644
--- a/help.c
+++ b/help.c
@@ -126,7 +126,7 @@ static int is_executable(const char *name)
!S_ISREG(st.st_mode))
return 0;
-#ifdef __MINGW32__
+#ifdef WIN32
{ /* cannot trust the executable bit, peek into the file instead */
char buf[3] = { 0 };
int n;
--git a/pager.c b/pager.c
index f416d38..86facec 100644
--- a/pager.c
+++ b/pager.c
@@ -9,7 +9,7 @@
static int spawned_pager;
-#ifndef __MINGW32__
+#ifndef WIN32
static void pager_preexec(void)
{
/*
@@ -72,7 +72,7 @@ void setup_pager(void)
static const char *env[] = { "LESS=FRSX", NULL };
pager_process.env = env;
}
-#ifndef __MINGW32__
+#ifndef WIN32
pager_process.preexec_cb = pager_preexec;
#endif
if (start_command(&pager_process))
diff --git a/run-command.c b/run-command.c
index 91f6d2e..cb006e7 100644
--- a/run-command.c
+++ b/run-command.c
@@ -75,7 +75,7 @@ fail_pipe:
trace_argv_printf(cmd->argv, "trace: run_command:");
-#ifndef __MINGW32__
+#ifndef WIN32
fflush(NULL);
cmd->pid = fork();
if (!cmd->pid) {
@@ -315,7 +315,7 @@ int run_command_v_opt_cd_env(const char **argv, int opt, const char *dir, const
return run_command(&cmd);
}
-#ifdef __MINGW32__
+#ifdef WIN32
static unsigned WINAPI run_thread(void *data)
{
struct async *async = data;
@@ -331,7 +331,7 @@ int start_async(struct async *async)
return error("cannot create pipe: %s", strerror(errno));
async->out = pipe_out[0];
-#ifndef __MINGW32__
+#ifndef WIN32
/* Flush stdio before fork() to avoid cloning buffers */
fflush(NULL);
@@ -360,7 +360,7 @@ int start_async(struct async *async)
int finish_async(struct async *async)
{
-#ifndef __MINGW32__
+#ifndef WIN32
int ret = wait_or_whine(async->pid, "child process", 0);
#else
DWORD ret = 0;
diff --git a/run-command.h b/run-command.h
index 0c00b25..fb34209 100644
--- a/run-command.h
+++ b/run-command.h
@@ -70,7 +70,7 @@ struct async {
int (*proc)(int fd, void *data);
void *data;
int out; /* caller reads from here and closes it */
-#ifndef __MINGW32__
+#ifndef WIN32
pid_t pid;
#else
HANDLE tid;
diff --git a/setup.c b/setup.c
index e3781b6..029371e 100644
--- a/setup.c
+++ b/setup.c
@@ -41,7 +41,7 @@ const char *prefix_path(const char *prefix, int len, const char *path)
const char *prefix_filename(const char *pfx, int pfx_len, const char *arg)
{
static char path[PATH_MAX];
-#ifndef __MINGW32__
+#ifndef WIN32
if (!pfx || !*pfx || is_absolute_path(arg))
return arg;
memcpy(path, pfx, pfx_len);
--
1.6.2.1.418.g33d56.dirty
next prev parent reply other threads:[~2009-09-14 13:13 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-14 13:11 [RFC/PATCH v2 00/17] Build Git with MSVC Marius Storm-Olsen
2009-09-14 13:11 ` [PATCH 01/17] Avoid declaration after statement Marius Storm-Olsen
2009-09-14 13:11 ` [PATCH 02/17] boolean is a typedef under MSVC, so rename variable to 'i_boolean' Marius Storm-Olsen
2009-09-14 13:11 ` [PATCH 03/17] Define SNPRINTF_SIZE_CORR=1 for Microsoft Visual C++ Marius Storm-Olsen
2009-09-14 13:11 ` [PATCH 04/17] Add define guards to compat/win32.h Marius Storm-Olsen
2009-09-14 13:11 ` [PATCH 05/17] Change regerror() declaration from K&R style to ANSI C (C89) Marius Storm-Olsen
2009-09-14 13:11 ` [PATCH 06/17] mingw.c: Use the O_BINARY flag to open files Marius Storm-Olsen
2009-09-14 13:11 ` [PATCH 07/17] Fix __stdcall/WINAPI placement and function prototype Marius Storm-Olsen
2009-09-14 13:11 ` Marius Storm-Olsen [this message]
2009-09-14 13:11 ` [PATCH 09/17] Add empty header files for MSVC port Marius Storm-Olsen
2009-09-14 13:11 ` [PATCH 10/17] Add MinGW header files to build git with MSVC Marius Storm-Olsen
2009-09-14 13:11 ` [PATCH 11/17] Add platform files for MSVC porting Marius Storm-Olsen
2009-09-14 13:11 ` [PATCH 12/17] Make usage of windows.h lean and mean Marius Storm-Olsen
2009-09-14 13:11 ` [PATCH 13/17] Define strncasecmp as _strnicmp for MSVC Marius Storm-Olsen
2009-09-14 13:11 ` [PATCH 14/17] Add ftruncate implementation " Marius Storm-Olsen
2009-09-14 13:11 ` [PATCH 15/17] Add MSVC to Makefile Marius Storm-Olsen
2009-09-14 13:11 ` [PATCH 16/17] Add README for MSVC build Marius Storm-Olsen
2009-09-14 13:11 ` [PATCH 17/17] Add scripts to generate projects for other buildsystems (MSVC vcproj, QMake) Marius Storm-Olsen
2009-09-14 14:06 ` [PATCH 15/17] Add MSVC to Makefile Alex Riesen
2009-09-14 19:09 ` Marius Storm-Olsen
2009-09-14 14:18 ` [PATCH 14/17] Add ftruncate implementation for MSVC Alex Riesen
2009-09-14 19:03 ` Marius Storm-Olsen
2009-09-14 19:48 ` Junio C Hamano
2009-09-14 19:31 ` [PATCH 08/17] Test for WIN32 instead of __MINGW32_ Junio C Hamano
2009-09-14 19:42 ` Marius Storm-Olsen
2009-09-14 20:00 ` [PATCH 07/17] Fix __stdcall/WINAPI placement and function prototype Johannes Sixt
2009-09-15 0:24 ` [msysGit] " Johannes Schindelin
2009-09-15 5:59 ` Marius Storm-Olsen
2009-09-14 19:06 ` [msysGit] [PATCH 06/17] mingw.c: Use the O_BINARY flag to open files Alexey Borzenkov
2009-09-14 13:41 ` [PATCH 02/17] boolean is a typedef under MSVC, so rename variable to 'i_boolean' Marius Storm-Olsen
2009-09-14 13:59 ` [PATCH 01/17] Avoid declaration after statement Alex Riesen
2009-09-14 14:01 ` Marius Storm-Olsen
2009-09-14 14:04 ` Frank Li
2009-09-14 14:10 ` Alex Riesen
2009-09-14 19:00 ` Marius Storm-Olsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8da5dcea21ce49b3a57fd224c088785a9f98e867.1252925290.git.mstormo@gmail.com \
--to=mstormo@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=lznuaa@gmail.com \
--cc=msysgit@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).