public inbox for cygwin-developers@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin-developers@cygwin.com
Subject: Re: Why is _WIN64 not defined as 1 in _cygwin.h?
Date: Thu, 25 Nov 2021 14:07:54 +0100	[thread overview]
Message-ID: <YZ+KquwAnq1scR/p@calimero.vinschen.de> (raw)
In-Reply-To: <1016746971.2414349.1637763426878@mail.yahoo.com>

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

  reply	other threads:[~2021-11-25 13:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1016746971.2414349.1637763426878.ref@mail.yahoo.com>
2021-11-24 14:17 ` Z. Majeed
2021-11-25 13:07   ` Corinna Vinschen [this message]
2021-11-25 18:06     ` Z. Majeed
2021-11-25 18:51       ` Corinna Vinschen
2021-11-26 10:47         ` Corinna Vinschen
2021-11-26 14:33           ` Z. Majeed
2021-11-26 16:07             ` Corinna Vinschen
2021-11-27 13:16               ` Z. Majeed
2021-11-29 10:46                 ` Corinna Vinschen
2021-11-29 14:18                   ` Z. Majeed
2021-11-29 14:33                     ` Z. Majeed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YZ+KquwAnq1scR/p@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin-developers@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).