Ramsay Jones said the following on 03.10.2009 22:06:
Marius Storm-Olsen wrote:
So, something like this maybe, in git-compat-util.h:
#if defined(__MINGW32__) || defined(_MSC_VER)
# defined API_WIN32
# defined OS_WINDOWS
#elif defined(__CYGWIN__)
# defined API_POSIX
# defined OS_WINDOWS
#else
# defined API_POSIX
#endif
This is a much better idea.
OK, I'll write up a patch, tomorrow or Monday.
...
So, I think something like this in git-compat-util.h:
#if defined(_WIN32) && !defined(__CYGWIN__)
# define WIN32_API
# define WIN32_LEAN_AND_MEAN
# include <winsock2.h>
# include <windows.h>
#endif
I agree with this one. Send a patch, and I'll ack.
and replace all #if(n)def WIN32|_WIN32 with #if(n)def WIN32_API.
Ok, I might look into that too then.
The only use of the <windows.h> header by cygwin can be moved
into compat/cygwin.c. (I don't much like cygwin using the
Win32 API anyway!)
I don't have Cygwin installed, so I won't touch this one.
So, then we can use #ifdef API_WIN32 when using the Win32 API is the
only option/preferred for MinGW or MSVC; and use #ifdef OS_WINDOWS
when there are things that affect all the Windows builds.
Opinions?
see above. I don't think OS_WINDOWS is necessary.
Well, it was mostly intended where we'd have code/algorithms which are
platform specific, and not really compiler specific; such as the *stat()
optimizations. They could probably be joined into an OS_WINDOWS section,
with a POSIX_API hunk for the Cygwin fallbacks.
Not really important though. Hopefully there won't be too much platform
specific stuff anyways.
--
.marius
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html