From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.135]) by sourceware.org (Postfix) with ESMTPS id E9EC83858D35 for ; Thu, 25 Nov 2021 13:07:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E9EC83858D35 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=cygwin.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=cygwin.com Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MfHUx-1m9ToF0Fp5-00gn0E for ; Thu, 25 Nov 2021 14:07:56 +0100 Received: by calimero.vinschen.de (Postfix, from userid 500) id F2F1EA80D44; Thu, 25 Nov 2021 14:07:54 +0100 (CET) Date: Thu, 25 Nov 2021 14:07:54 +0100 From: Corinna Vinschen To: cygwin-developers@cygwin.com Subject: Re: Why is _WIN64 not defined as 1 in _cygwin.h? Message-ID: Reply-To: cygwin-developers@cygwin.com Mail-Followup-To: cygwin-developers@cygwin.com References: <1016746971.2414349.1637763426878.ref@mail.yahoo.com> <1016746971.2414349.1637763426878@mail.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1016746971.2414349.1637763426878@mail.yahoo.com> X-Provags-ID: V03:K1:B2WXsRToQ1EFoif5MSUaV2as7P2zGXmwpmFtmR95KRpHFa+umnf 075mgPlMHo3LQiF1/sycyuuo1wKfnQMaHcm2mmIl0qO+T6hxElvAn+jWx5RwmVRWn0c6hjW 2+1Y2cb737FNxQ86ObgIwlUHfuQxgkAyshG9EipT8htbgNOcQX7X0+sYTJ7XlkEzClCS+4z B4CqY3aupDeLA6ciRAttQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:jdvHAehQAm0=:cyxVkxgFiMWgKlNz3JEXrp sQsORrGVFZfv3Gk9s1OnTud6GUewrZo03A+96xE2WbU5fH99FYueqxdHych4nnZSaOZ87+lbQ nyI3YVUqUSWM30++vxnNwbnOKj2pKYsM1psaXDy4FIvSlWDOFYz4jZfdl/OSW34OGxsQIFdjg mhfbdlZJwpQe+Ha0BhX5xLLrgmtzxJhFgr7QdVT6FEJYG4mav5+rorU3kj8MfxUn6Y+qp9Kr9 l63Ui2o/+PYC8RH0QqIsB2Y07d1eXReKODEJszs/Qacm0AU7vh0cSl7BtWduGy9lBD6Dh1xH7 +5GCjvOSC62u6y66k2eEs/35cVnYEQ178wHqlpMDmTsmd6kuU38/GNOzEvehbvh1zTm+4uEJ6 a5nykKClU7a+2Yxqi75bTtdhVi2CEYyHiHpJ+GK26XJ9WRXsId9JafuA/aneHTFcEIIqUhttB hoAIx0EZFzFOIZPtC1LZND1FxC12OC5Bdy3L6KBAKIKwFhxnQUPZXlxtkmC99ErnyOMY/NsP4 SXCoBqus+ar8F8sKUgZ5FXBKMqxopZsSKmq7C6mE8qZjlk+nI0ahXtPIYpToJ4KBfboYUSFci TgjyJk6SgdcAMOXzS9fOCk9PfJrTIFhn94xj17kyvmEJIk788a8ROYrb/aH46cheHf9flUTJU Y3IDFzENuuYy2XGw/ftR76pNOPbL2sbnBvBKU0VXksA4WRv3GOCXixk+sjEPb2iN58Lx2WDKH Z+/iJ+5cWmyWCxRL X-Spam-Status: No, score=-99.4 required=5.0 tests=BAYES_00, GOOD_FROM_CORINNA_CYGWIN, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: cygwin-developers@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component developers mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Nov 2021 13:08:03 -0000 On Nov 24 14:17, Z. Majeed wrote: > /* _WIN64 is defined by the compiler specs when targeting Windows.  >  The Cygwin-targeting gcc does not define it by default, same as  >  with _WIN32.  Therefore we set it here.  The result is that _WIN64  >  is only defined if Windows headers are included. */#ifdef > __x86_64__#define _WIN64#endif This gives compile errors wherever > _WIN64 is used in oneTBB code in expressions like #if _WIN32 || _WIN64 > e.g. at > https://github.com/oneapi-src/oneTBB/blob/master/test/tbbmalloc/test_malloc_compliance.cpp#L38 > The _WIN64 predefined macro is documented at > https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros > "_WIN64 Defined as 1 when the compilation target is 64-bit ARM or x64. > Otherwise, undefined." Why has cygwin chosen to define _WIN64 with no > value? Because it was sufficient at the time and nobody actually cared until today, I guess. As for mixing Cygwin and Windows calls, I'd like to point out https://cygwin.com/faq.html#faq.programming.64bitporting Not saying you did something wrong, but the fact that the long datatype differs in size requires some careful checking when porting stuff. > Can _WIN64 instead be defined as 1 per Microsoft specification? Note that this is just the Cygwin-specific part of the mingw-w64 project, not Cygwin itself. If you want to change that, just send a patch to the mingw-w64 mailing list. Corinna