__AMD64__ is defined when 64bit x86 instruction set is used,
which is true for x32. The difference is x32 doesn't define
__LP64__.

H.J.


> -----Original Message-----
> From: Alan Coopersmith [mailto:[email protected]]
> Sent: Wednesday, December 21, 2011 11:33 AM
> To: Sergei Trofimovich
> Cc: Lu, Hongjiu; [email protected]
> Subject: Re: [xproto: PATCH] Xmd.h: amd64-x32 ABI defines sizeof(long) ==
> sizeof (void*) == 4
> 
> On 12/21/11 09:24, Sergei Trofimovich wrote:
> > What do you think of changing predefined __amd64__ define in gcc to
> something
> > distinct?
> >
> > If it's not an option, how about adding one more define for those who like
> to check
> > for this exact feature on all compilers (and not only gcc)?
> >
> > So thread start's use case would look like
> >
> >      -#if defined(__amd64__)
> >      -#    define LONG64
> >      -#endif
> >      +#if defined(__amd64__)&&  !defined(__amd64_x32__)
> >      +#    define LONG64
> >      +#endif
> >
> > which would be less fragile for existing compilers.
> 
> The correct thing to do would be to never define __amd64__ if you are not
> building software using the characteristics tons of existing software
> associate
> with __amd64__ - almost all C code using this cares about the pointer sizes
> you're redefining - it doesn't care about the number of registers or other
> attributes not visible at the C source code level.
> 
> That would result in no patch to X or thousands of other programs.
> 
> --
>       -Alan Coopersmith-        [email protected]
>        Oracle Solaris Platform Engineering: X Window System

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to