mingw: avoid warnings when casting HANDLEs to int

HANDLE is defined internally as a void *, but in many cases it is
actually guaranteed to be a 32-bit integer. In these cases, GCC should
not warn about a cast of a pointer to an integer of a different type
because we know exactly what we are doing.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Johannes Schindelin
2016-01-15 14:24:34 +01:00
committed by Junio C Hamano
parent 59de49f80d
commit 7c00bc39eb
3 changed files with 9 additions and 5 deletions

View File

@ -76,7 +76,7 @@
#ifdef WIN32_NATIVE
#define IsConsoleHandle(h) (((long) (h) & 3) == 3)
#define IsConsoleHandle(h) (((long) (intptr_t) (h) & 3) == 3)
static BOOL
IsSocketHandle (HANDLE h)