Make mingw_spawn* buildable by VS 2008
commitc940699d02aaff2e060315095d1799be41bc99d3
authorKirill <kirillathome@gmail.com>
Wed, 3 Sep 2008 01:48:02 +0000 (2 21:48 -0400)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Sat, 18 Oct 2008 14:26:27 +0000 (18 16:26 +0200)
treecfffce32c1d77b22f3a52810445e4a312082dfa4
parentffe7c28f315589e2ba44c1ef27eb4564646a03ef
Make mingw_spawn* buildable by VS 2008

The biggest chunk is the new git-compat-util.h and cache.h that are
compatible with both gcc and VS 2008.

The rest of the changes:
- sha1_file.c: use only part of the original file;
- compat/mingw.[ch]: minor changes caused by difference in header files,
  easily portable back to git (see cosmetic changes below);
- usage.c: minor changes, related to the use of NORETURN attribute, easily
  portable back to git (see cosmetic changes below);
- strbuf.c: very minor changes to fix some warnings.

There are several kinds of cosmetic changes in this commit:
- VS 2008 enforces C much stricter than gcc; for example, it does not allow
  declaring variables in the middle of a function;

- apparently, VS 2008 is much pickier about the placement of declaration
  specification (see ticktrack in compat/mingw.c);

- headers are slightly different (see struct pollfd in compat/mingw.h);

- va_copy is apparently unavailable in VS 2008;

- VS 2008 is apparently much pickier about possible loss of data and type
  mismatch, hence some additional casting [in strbuf.c];

- VS 2008 does not have __attribute__ and does not allow to use NORETURN
  in variable or parameter declarations [in usage.c].

This changes to the "borrowed" files do not break the build of git, but
no tests have been exec'd.
Makefile
cache.h [new file with mode: 0644]
compat/mingw.c
compat/mingw.h
git-compat-util.h [new file with mode: 0644]
sha1_file.c
strbuf.c
usage.c