X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:subject:to:references:from:message-id:date
	:mime-version:in-reply-to:content-type
	:content-transfer-encoding; q=dns; s=default; b=dQJ23zTKG3bQZ4S+
	jcwbW2Il5o9IVkDi2geM9VEHbKj2Sy+lpV44mF0TToHHiVlczapX+sUdPW1Ew4HQ
	dD2h60OLwAdeT+I80pcobJqzAtmrJlnJoaZQE+MPDfMzTm3LBmu9FqcVcLPojIDl
	b1r+fb9yBlNaHY4TdKdtIXdiQCo=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:subject:to:references:from:message-id:date
	:mime-version:in-reply-to:content-type
	:content-transfer-encoding; s=default; bh=9ch4/9qWlwUQwkd34eVf+4
	p/ik4=; b=oygMQZMB4NxH1jU5YJF70bQrgCw9ccY7dWQaQC61D6afTtT8Jzh2dT
	HrhrRMUFn7l7VoRM+bO6TghzBK3lygIzareNTTqxCY8F3o27+BIX7iRFfc7QbCXA
	9wGNl9yZKRcjUhmxDJUG9bV1JeirEtTDU+vrNQO/G7lYCvXYdoKgA=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_FAIL,SPF_HELO_PASS autolearn=no version=3.3.1 spammy=Problem, HX-Languages-Length:952, HContent-Transfer-Encoding:8bit
X-HELO: gateway22.websitewelcome.com
Subject: Re: Why is __unix__ defined, and not __WINDOWS__ ?
To: cygwin@cygwin.com
References: <5fbb6229-da17-c056-19b9-9819c684a8ad@agner.org> <8e9bfbb4-2139-639d-afaa-dfbacac1a8d9@t-online.de>
From: Agner Fog <agner@agner.org>
Message-ID: <dfd043fb-620a-81a1-1611-91a982fc96cd@agner.org>
Date: Mon, 13 May 2019 06:12:07 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <8e9bfbb4-2139-639d-afaa-dfbacac1a8d9@t-online.de>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
X-IsSubscribed: yes

But the compiler generates a Windows executable following most of the 
Windows ABI (object file format, calling convention, etc.)


On 12/05/2019 21.53, Hans-Bernhard Bröker wrote:
> Am 12.05.2019 um 20:22 schrieb Agner Fog:
>
>> I have noticed that the gcc and clang compilers have defined the
>> preprocessing macro __unix__, but not __WINDOWS__, _WIN32, or _WIN64
>> when compiling a windows executable.
>>
>> Why is this?
> Because it's correct that way.  Cygwin runs on Windows, but it _is_ not
> Windows.
>
>> A C/C++ program will check for these macros if it wants to know which
>> operating system you are compiling for, and this will give the wrong
>> result.
> No.  It gives the correct result.
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>
>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

