delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/05/13/00:12:22

X-Recipient: archive-cygwin AT delorie DOT 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 AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT 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 AT cygwin DOT com
References: <5fbb6229-da17-c056-19b9-9819c684a8ad AT agner DOT org> <8e9bfbb4-2139-639d-afaa-dfbacac1a8d9 AT t-online DOT de>
From: Agner Fog <agner AT agner DOT 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>
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019