From: Ramsay Jones Date: Fri, 15 Jan 2010 20:12:19 +0000 (+0100) Subject: MSVC: Fix an "incompatible pointer types" compiler warning X-Git-Tag: v1.7.0-rc0~86^2~2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/b6f714f89a2abb591e6d46595f43bc8d4d356a72?hp=b6f714f89a2abb591e6d46595f43bc8d4d356a72 MSVC: Fix an "incompatible pointer types" compiler warning In particular, the following warning is issued while compiling compat/msvc.c: ...mingw.c(223) : warning C4133: 'function' : incompatible \ types - from '_stati64 *' to '_stat64 *' which relates to a call of _fstati64() in the mingw_fstat() function definition. This is caused by various layers of macro magic and attempts to avoid macro redefinition compiler warnings. For example, the call to _fstati64() mentioned above is actually a call to _fstat64(), and expects a pointer to a struct _stat64 rather than the struct _stati64 which is passed to mingw_fstat(). The definition of struct _stati64 given in compat/msvc.h had the same "shape" as the definition of struct _stat64, so the call to _fstat64() does not actually cause any runtime errors, but the structure types are indeed incompatible. In order to avoid the compiler warning, we add declarations for the mingw_lstat() and mingw_fstat() functions and supporting macros to msvc.h, suppressing the corresponding declarations in mingw.h, so that we can use the appropriate structure type (and function) names from the msvc headers. Signed-off-by: Ramsay Jones Signed-off-by: Johannes Sixt Signed-off-by: Junio C Hamano ---