diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-01-29 01:10:13 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-01-29 01:10:14 +0100 |
commit | 116a866bf50da9b893623ebb940e1c6bff7a29bc (patch) | |
tree | 34101d20455fa65c52c406c92f6b6a2007585135 /compat/mingw.c | |
parent | Merge branch 'tk/interpret-trailers-in-place' (diff) | |
parent | mingw: uglify (a, 0) definitions to shut up warnings (diff) | |
download | git-116a866bf50da9b893623ebb940e1c6bff7a29bc.tar.xz git-116a866bf50da9b893623ebb940e1c6bff7a29bc.zip |
Merge branch 'js/msys2'
Beginning of the upstreaming process of Git for Windows effort.
* js/msys2:
mingw: uglify (a, 0) definitions to shut up warnings
mingw: squash another warning about a cast
mingw: avoid warnings when casting HANDLEs to int
mingw: avoid redefining S_* constants
compat/winansi: support compiling with MSys2
compat/mingw: support MSys2-based MinGW build
nedmalloc: allow compiling with MSys2's compiler
config.mak.uname: supporting 64-bit MSys2
config.mak.uname: support MSys2
Diffstat (limited to 'compat/mingw.c')
-rw-r--r-- | compat/mingw.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/compat/mingw.c b/compat/mingw.c index 5edea29508..7115e4e09e 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -6,6 +6,8 @@ #include "../run-command.h" #include "../cache.h" +#define HCAST(type, handle) ((type)(intptr_t)handle) + static const int delay[] = { 0, 1, 10, 20, 40 }; int err_win_to_posix(DWORD winerr) @@ -691,13 +693,13 @@ int pipe(int filedes[2]) errno = err_win_to_posix(GetLastError()); return -1; } - filedes[0] = _open_osfhandle((int)h[0], O_NOINHERIT); + filedes[0] = _open_osfhandle(HCAST(int, h[0]), O_NOINHERIT); if (filedes[0] < 0) { CloseHandle(h[0]); CloseHandle(h[1]); return -1; } - filedes[1] = _open_osfhandle((int)h[1], O_NOINHERIT); + filedes[1] = _open_osfhandle(HCAST(int, h[1]), O_NOINHERIT); if (filedes[1] < 0) { close(filedes[0]); CloseHandle(h[1]); @@ -1846,7 +1848,8 @@ void mingw_open_html(const char *unixpath) die("cannot run browser"); printf("Launching default browser to display HTML ...\n"); - r = (int)ShellExecute(NULL, "open", htmlpath, NULL, "\\", SW_SHOWNORMAL); + r = HCAST(int, ShellExecute(NULL, "open", htmlpath, + NULL, "\\", SW_SHOWNORMAL)); FreeLibrary(shell32); /* see the MSDN documentation referring to the result codes here */ if (r <= 32) { |