Compile fix for MSVC: Do not include sys/resources.h
commitbcfb74d23c13dfda1a0045eb6461ef1682143862
authorVincent van Ravesteijn <vfr@lyx.org>
Mon, 31 Oct 2011 19:12:42 +0000 (31 20:12 +0100)
committerErik Faye-Lund <kusmabite@gmail.com>
Tue, 1 Nov 2011 10:52:27 +0000 (1 11:52 +0100)
tree06d90371b250b5aaecfd286bfec81e7145716701
parent319312f0c1a1ec6887b4cf21210baab6b9e99a33
Compile fix for MSVC: Do not include sys/resources.h

Do not include header files when compiling with MSVC that do not
exist and which are also not included when compiling with MINGW.
A direct consequence is that git can be compiled again with MSVC
because the missing "sys/resources.h" is no longer included.

Instead of current

#ifndef mingw32 is the only one that is strange
        ... everything for systems that is not strange ...
        #else
        ... include mingw specific tweaks ...
        #endif
        #ifdef msvc is also strange
        ... include msvc specific tweaks ...
        #endif

it turns things around and says what it wants to achieve in a more direct
way, i.e.

#if mingw32
        #include "compat/mingw.h"
#elif msvc
        #include "compat/msvc.h"
#else
        ... all the others ...
#endif

which makes it look simpler.

Signed-off-by: Vincent van Ravesteijn <vfr@lyx.org>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
git-compat-util.h