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:to:from:subject:message-id:date:mime-version
	:content-type:content-transfer-encoding; q=dns; s=default; b=buL
	rn9SGNgKEWA+yKpvr7W0Gt0JgWSpXIDr7wPaBQf+T2OGOcAlGByepjLmjbkocxr8
	9k+HJoN4vvxJ3Vdex2U+FH0U/E9SMrP1SxoDgI4zuXIXakfMEuTFNrKMlF1P/ZOW
	8XTx4I33y5mLcU30qzIfHTADxzF8oGCt0n9iZg7U=
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:to:from:subject:message-id:date:mime-version
	:content-type:content-transfer-encoding; s=default; bh=iAom/aKaU
	w2QUwrCfZZ3dY0M+WQ=; b=WwS6zdZRznrKDetfN7sJrKVdMSrCllHOCBhQ6Q0Ms
	SSqOKnc1Hva2fWI+mAj/ZSIA9TQgIU/b6LGxAa+/v6n/qAJA97GwFwYJWM/HWtQd
	tYJBEXNX6sRzd6VpuApO6bp3E6xs0TpD5VVHHZwD1q/kwqTqZZYnCErcBNo+jwZ5
	QM=
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=H*MI:da17, H*M:da17
X-HELO: gateway34.websitewelcome.com
To: cygwin@cygwin.com
From: Agner Fog <agner@agner.org>
Subject: Why is __unix__ defined, and not __WINDOWS__ ?
Message-ID: <5fbb6229-da17-c056-19b9-9819c684a8ad@agner.org>
Date: Sun, 12 May 2019 20:22:36 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

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?

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.




--
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

