git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marius Storm-Olsen <marius@storm-olsen.com>
To: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Cc: Alex Riesen <raa.lkml@gmail.com>,
	GIT Mailing-list <git@vger.kernel.org>,
	"Shawn O. Pearce" <spearce@spearce.org>
Subject: Re: MSVC build broken (on cygwin)
Date: Sat, 03 Oct 2009 22:29:31 +0200	[thread overview]
Message-ID: <4AC7B42B.8020506@gmail.com> (raw)
In-Reply-To: <4AC7AEB9.3030404@ramsay1.demon.co.uk>

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

  reply	other threads:[~2009-10-03 20:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-01 17:11 MSVC build broken (on cygwin) Ramsay Jones
2009-10-02  8:07 ` Marius Storm-Olsen
2009-10-02  8:23   ` Alex Riesen
2009-10-02  8:49     ` Marius Storm-Olsen
2009-10-03 20:06       ` Ramsay Jones
2009-10-03 20:29         ` Marius Storm-Olsen [this message]
2009-10-03 19:36   ` Ramsay Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AC7B42B.8020506@gmail.com \
    --to=marius@storm-olsen.com \
    --cc=git@vger.kernel.org \
    --cc=raa.lkml@gmail.com \
    --cc=ramsay@ramsay1.demon.co.uk \
    --cc=spearce@spearce.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).