Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-ID: <003b01c28991$00ebc5b0$78d96f83@pomello>
From: "Max Bowsher" <maxb@ukf.net>
To: "Eric Belhomme" <rico@ricospirit.net>, <cygwin@cygwin.com>
References: <Xns92C2C61BC83D7ericbelhommefreefr@80.91.224.249> <20021110192754.9C6662CA74@inet1.ywave.com> <002e01c2896d$ca899510$0a01a8c0@athlon>
Subject: Re: how-to use _WIN32 preprocessor with cygwin ?
Date: Mon, 11 Nov 2002 14:45:39 -0000
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106

Eric Belhomme <rico@ricospirit.net> wrote:

>> The cygwin-specific gcc compile flag -mwin32 causes the _WIN32 macro
>> to be defined.  Certain cygwin applications predate that
>> arrangement, so confusion is understandable.
>>
> Thanks for your answer :-)
> So I wonder I have  to modify the configure script to add -mwin32
> flag on gcc option if I detect cygwin environment. Question : How to
> detect cygwin environment ?

Or, just use code like this in your C files:

#if defined(_WIN32) || defined(__CYGWIN__)
Win32 or Cygwin
#endif

If you do want to detect Cygwin in a configure script, then you just do
AC_CANONICAL_HOST, and then:

case $host_os in
  *cygwin* ) do cygwin stuff;;
         * ) do other stuff;;
esac



Max.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

