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.