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:date:message-id:from:reply-to:to:subject :references:in-reply-to:content-type; q=dns; s=default; b=gS/DMX 9uTaP68mBzjyoNe5owhz2MTtmtpI8pU2fhvksflObqZbxyhl93vWSLv8SvA8ccIQ IuhAoSeYr3hgRpy2kBuBa/wXlrpzVnPIP0VfawPPMxLeTkqDH3uDBbQ0nYYX7Fla As42kPuL5V+fkMs4tuxrsd7ZbEp0jVFR+mYnI= 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:date:message-id:from:reply-to:to:subject :references:in-reply-to:content-type; s=default; bh=CztnZoysliAP 55YUxKz/4d8DYRg=; b=uEtHN7n2RRCh5C22ves2aVRXbHAQvxSMNLuzaEbbwHyM GWrFO6FyYPFvtFwsF2vG0aMwhg6+18iJHYMUQMOjCCVIvp3O9x8qNo3Hg/0eTp2I DUhpCgnnImF3tVuRkT6NC0D1xdc8wqiAcBQ/dgWLM9B9Db3TeTtGisQ9K2Mas7U= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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=-2.3 required=5.0 tests=AWL,BAYES_00,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: lb1-smtp-cloud8.xs4all.net Date: Sun, 12 May 2019 21:52:54 +0200 Message-ID: <5505261f3571c3615ec80146a27134da@smtp-cloud8.xs4all.net> From: Houder Reply-To: cygwin AT cygwin DOT com To: cygwin AT cygwin DOT com Subject: Re: Why is __unix__ defined, and not __WINDOWS__ ? References: <5fbb6229-da17-c056-19b9-9819c684a8ad AT agner DOT org> In-Reply-to: <5fbb6229-da17-c056-19b9-9819c684a8ad@agner.org> Content-Type: text/plain; charset=UTF-8; format=fixed User-Agent: mua.awk 0.99 On Sun, 12 May 2019 20:22:36, Agner Fog wrote: > 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. ????? (or: I dont quite follow your drift) Henri 64-@@ x86_64-w64-mingw32-gcc -dM -E - < /dev/null | grep -i win #define _WIN32 1 #define _WIN64 1 #define __WINT_MAX__ 0xffff #define __WINT_MIN__ 0 #define __WIN32 1 #define __WIN64 1 #define __WINNT 1 #define __WINNT__ 1 #define __WIN32__ 1 #define __SIZEOF_WINT_T__ 2 #define WIN32 1 #define WIN64 1 #define __WINT_TYPE__ short unsigned int #define __WINT_WIDTH__ 16 #define WINNT 1 #define __WIN64__ 1 64-@@ x86_64-w64-mingw32-g++ -dM -E -x c++ - < /dev/null | grep -i win #define _WIN32 1 #define _WIN64 1 #define __WINT_MAX__ 0xffff #define __WINT_MIN__ 0 #define __WIN32 1 #define __WIN64 1 #define __WINNT 1 #define __WINNT__ 1 #define __WIN32__ 1 #define __SIZEOF_WINT_T__ 2 #define WIN32 1 #define WIN64 1 #define __WINT_TYPE__ short unsigned int #define __WINT_WIDTH__ 16 #define WINNT 1 #define __WIN64__ 1 ===== -- 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