This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch bfd]: Add further support for x86_64 mingw
- From: Kai Tietz <Kai dot Tietz at onevision dot com>
- To: Pedro Alves <pedro_alves at portugalmail dot pt>
- Cc: Pedro Alves <alves dot ped at gmail dot com>, Binutils <binutils at sourceware dot org>
- Date: Thu, 24 Jan 2008 09:27:54 +0100
- Subject: Re: [patch bfd]: Add further support for x86_64 mingw
Pedro Alves wrote on 24.01.2008 02:26:18:
> Brian Dessent wrote:
>
> > Is _WIN32 really the right thing to predicate this on? For example
> > someone using Cygwin and also using the w32api directly (by #include
> > <windows.h>) will have _WIN32 defined, but they aren't using MSVCRT
and
> > so I64x is wrong. Admittedly this is probably not something that is
> > likely to occur in bfd, and I know this is a common idiom, but why not
> > conditionalize it on __MSVCRT__ instead? MinGW gcc defines this as a
> > builtin right next to _WIN32 but it is not overloaded with the meaning
> > of "I'm using the Windows headers."
> >
>
> __MSVCRT__ is defined if using the the msvcrt.dll runtime. If using the
> old crtdll runtime it is __CRTDLL__ (gcc/config/crtdll.h). For Windows
> CE, it is coredll.dll, so it is __COREDLL__ that gets defined.
>
> Isn't it usual to do:
> #if defined (_WIN32) && !defined (__CYGWIN__)
>
> or:
> #ifdef __MINGW32__
> ?
You are right, that the simple chack for __MSVCRT__ isn't engough, but the
pattern
> #if defined (_WIN32) && !defined (__CYGWIN__)
seems to be a bit misleading. IMHO the clause should be something like
#if defined(__CRTDLL__) || defined(__MSVCRT__)
This pattern matches for crtdll (ce), uwin, cygwin, and mingw.
Do you agree?
Cheers,
i.A. Kai Tietz
| (\_/) This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.
------------------------------------------------------------------------------------------
OneVision Software Entwicklungs GmbH & Co. KG
Dr.-Leo-Ritter-StraÃe 9 - 93049 Regensburg
Tel: +49.(0)941.78004.0 - Fax: +49.(0)941.78004.489 - www.OneVision.com
Commerzbank Regensburg - BLZ 750 400 62 - Konto 6011050
Handelsregister: HRA 6744, Amtsgericht Regensburg
KomplementÃrin: OneVision Software Entwicklungs Verwaltungs GmbH
Dr.-Leo-Ritter-StraÃe 9 â 93049 Regensburg
Handelsregister: HRB 8932, Amtsgericht Regensburg - GeschÃftsfÃhrer:
Ulrike DÃhler, Manuela Kluger