From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 46255 invoked by alias); 12 May 2019 19:52:59 -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 46246 invoked by uid 89); 12 May 2019 19:52:59 -0000 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 Received: from lb1-smtp-cloud8.xs4all.net (HELO lb1-smtp-cloud8.xs4all.net) (194.109.24.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 12 May 2019 19:52:57 +0000 Received: from tmp.ssRk3j57T1 ([83.162.234.136]) by smtp-cloud8.xs4all.net with ESMTPSA id PuWhhftlv0YQePuWihbgTr; Sun, 12 May 2019 21:52:54 +0200 Date: Sun, 12 May 2019 19:52:00 -0000 Message-ID: <5505261f3571c3615ec80146a27134da@smtp-cloud8.xs4all.net> From: Houder Reply-To: cygwin@cygwin.com To: cygwin@cygwin.com Subject: Re: Why is __unix__ defined, and not __WINDOWS__ ? References: <5fbb6229-da17-c056-19b9-9819c684a8ad@agner.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 X-SW-Source: 2019-05/txt/msg00097.txt.bz2 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