From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17604 invoked by alias); 12 May 2019 20:33:44 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 17597 invoked by uid 89); 12 May 2019 20:33:44 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.1 spammy=gran, Gran, Mike, somebody X-HELO: sonic315-14.consmr.mail.bf2.yahoo.com Received: from sonic315-14.consmr.mail.bf2.yahoo.com (HELO sonic315-14.consmr.mail.bf2.yahoo.com) (74.6.134.124) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 12 May 2019 20:33:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1557693220; bh=9hvC9Oa+ES1m+Q0hW9LJxWNK/tTR4LzogJXPZ21zoz8=; h=Date:From:To:Subject:References:In-Reply-To:From:Subject; b=heD+a8ecYFD66pbxDhOiACx7h5P2EUk6erbnIcCVehiDW4A6ZvAFjU0tR5DeOWhGPehwEIqLxbDBaPkkY09jVsZUJniWcnfmhJB+u4dVophOtDkqTsFi8h1jj4V2e8zpOvkqyvHrDdOc+ZYnWa8nOkcrqQHA8WLnFBBGEtGHY8UesquyX7rC+BGuEiHhY5tFWPoA/0eDb6KbMI1NUcBK4JHMutnWIq5mJ2r/RXpERQ5lminwmvhdwVKp6S1QCXhRHT15FeZsUREkGVkafHZyITZ52rbr1elk40n8QA+p4gF4fyk9OnPBzXRFhtihLahiZhPgxE0fnF3sG7WJhkYn0g== Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.bf2.yahoo.com with HTTP; Sun, 12 May 2019 20:33:40 +0000 Received: from 75-54-112-187.lightspeed.irvnca.sbcglobal.net (EHLO spikycactus.attlocal.net) ([75.54.112.187]) by smtp419.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID f8a345902ca7d9675318813504bef031 for ; Sun, 12 May 2019 20:33:36 +0000 (UTC) Date: Sun, 12 May 2019 20:33:00 -0000 From: "Mike Gran via cygwin" Reply-To: Mike Gran To: cygwin@cygwin.com Subject: Re: Why is __unix__ defined, and not __WINDOWS__ ? Message-ID: <20190512203330.GA30710@spikycactus.attlocal.net> References: <5fbb6229-da17-c056-19b9-9819c684a8ad@agner.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5fbb6229-da17-c056-19b9-9819c684a8ad@agner.org> User-Agent: Mutt/1.11.3 (2019-02-01) X-IsSubscribed: yes X-SW-Source: 2019-05/txt/msg00100.txt.bz2 On Sun, May 12, 2019 at 08:22:36PM +0200, 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? As I understand it, when using the cygwin compiler to compile for the cygwin target, these defines are intentionally not defined, because Cygwin is supposed to look and feel like a Posix platform, not a windows one. The various MinGW compilers do define these constants because the target is native windows. I think these days the canonical defines are (somebody correct me if I'm wrong) __CYGWIN__ for Cygwin _WIN32 as 1 on MinGW when the compilation target is Windows 32-bit ARM, 64-bit ARM, x86, or x64. Otherwise, undefined. _WIN64 as 1 on MinGW when the compilation target is Windows 64-bit ARM or x64. Otherwise, undefined I am not a maintainer. - Mike Gran -- 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