git/compat
Ramsay Jones b6f714f89a 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 <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-16 16:43:55 -08:00
..
fnmatch Fix more typos/spelling in comments 2009-04-22 19:03:39 -07:00
nedmalloc Fix typo in nedmalloc warning fix 2009-06-11 14:18:52 -07:00
regex Change regerror() declaration from K&R style to ANSI C (C89) 2009-09-18 20:00:42 -07:00
vcbuild Merge branch 'ef/msys-imap' 2009-11-17 22:03:00 -08:00
basename.c compat: add a basename() compatibility function 2009-05-31 17:57:59 -07:00
bswap.h Explicitly truncate bswap operand to uint32_t 2009-11-25 00:16:38 -08:00
cygwin.c Fix more typos/spelling in comments 2009-04-22 19:03:39 -07:00
cygwin.h cygwin: Use native Win32 API for stat 2008-09-30 14:30:06 -07:00
fopen.c compat/fopen.c: avoid clobbering the system defined fopen macro 2008-05-08 17:43:01 -07:00
hstrerror.c Add a local implementation of hstrerror for the system which do not have it 2007-06-15 22:48:34 -07:00
inet_ntop.c Remove a couple of duplicated include 2007-11-05 20:50:38 -08:00
inet_pton.c Remove a couple of duplicated include 2007-11-05 20:50:38 -08:00
memmem.c optimize compat/ memmem() 2009-03-02 18:28:06 -08:00
mingw.c Windows: avoid the "dup dance" when spawning a child process 2010-01-16 16:43:53 -08:00
mingw.h MSVC: Fix an "incompatible pointer types" compiler warning 2010-01-16 16:43:55 -08:00
mkdtemp.c Define compat version of mkdtemp for systems lacking it 2007-10-20 22:52:21 -04:00
mkstemps.c compat: add a mkstemps() compatibility function 2009-05-31 17:56:44 -07:00
mmap.c War on whitespace 2007-06-07 00:04:01 -07:00
msvc.c Add platform files for porting to MSVC 2009-09-18 20:00:42 -07:00
msvc.h MSVC: Fix an "incompatible pointer types" compiler warning 2010-01-16 16:43:55 -08:00
pread.c Replacing the system call pread() with lseek()/xread()/lseek() sequence. 2007-01-09 16:40:40 -08:00
qsort.c compat: Add simplified merge sort implementation from glibc 2008-02-06 22:35:28 -08:00
setenv.c simplify inclusion of system header files. 2006-12-20 09:51:35 -08:00
snprintf.c Test for WIN32 instead of __MINGW32_ 2009-09-18 20:00:42 -07:00
strcasestr.c Clean up compatibility definitions. 2005-12-05 15:50:29 -08:00
strlcpy.c simplify inclusion of system header files. 2006-12-20 09:51:35 -08:00
strtoumax.c Add a compat/strtoumax.c for Solaris 8. 2007-02-19 18:20:30 -08:00
unsetenv.c simplify inclusion of system header files. 2006-12-20 09:51:35 -08:00
win32.h Make usage of windows.h lean and mean 2009-09-18 20:00:42 -07:00
win32mmap.c MSVC: Add support for building with NO_MMAP 2009-11-08 17:59:12 -08:00
winansi.c Make usage of windows.h lean and mean 2009-09-18 20:00:42 -07:00