64 bit Cygwin target and _WIN64

Pedro Alves alves.ped@gmail.com
Thu Jul 19 10:41:00 GMT 2012

On 07/19/2012 09:40 AM, Corinna Vinschen wrote:

> I had a more or less sleepless night thinking about this stuff, but the
> more I think about it, the more I think that just #defining _WIN64 in
> the Windows headers if called from a x86_64-targeting Cygwin compiler is
> the right thing to do.  On one hand a 64 bit Cygwin application will
> get the correct Windows definitions, on the other hand the impact on the
> Mingw64 headers is minimal.

You might even get zero impact on the Mingw64 headers, if you find a central
Windows header that all other headers include first (ISTR there used to be one,
windef.h, mingw.h or something like that on the w32api side), and put a Cygwin-specific
one with the same name earlier on the Cygwin system include search paths
that just does:

#define _WIN64
#include_next <foo_central_header_whatever_its_called_maybe_windef.h>

This header would be controlled and shipped by Cygwin.

Pedro Alves

More information about the Cygwin-developers mailing list