[PATCH libXt] Fix builds on X32

Alan Coopersmith alan.coopersmith at oracle.com
Mon May 18 10:06:32 PDT 2015


__LP64__ is not universally defined on all platforms (Solaris for instance
uses _LP64).

Last time this came up, the compromise between not breaking existing platforms
and letting people who don't understand API's & ABI's make up a new one was to
check for ILP32:
http://thread.gmane.org/gmane.comp.freedesktop.xorg.devel/27443/
which resulted in:
http://cgit.freedesktop.org/xorg/proto/x11proto/commit/Xmd.h?id=a06fa7fc98b66652df8bbc4734b5010d43744373

	-alan-

On 05/18/15 09:05 AM, Ross Burton wrote:
> The x86 X32 ABI is a 32-bit environment on 64-bit processors, so __amd64__ is
> defined but pointers and longs are 32-bit. Handle this case by also checking
> __LP64__.
>
> Signed-off-by: Ross Burton <ross.burton at intel.com>
> ---
>   include/X11/Xtos.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/X11/Xtos.h b/include/X11/Xtos.h
> index 64b2da8..44f52c2 100644
> --- a/include/X11/Xtos.h
> +++ b/include/X11/Xtos.h
> @@ -59,7 +59,7 @@ SOFTWARE.
>       defined(__sparc64__) || \
>       defined(__s390x__) || \
>       (defined(__hppa__) && defined(__LP64__)) || \
> -    defined(__amd64__) || defined(amd64) || \
> +    ((defined(__amd64__) || defined(amd64)) && defined(__LP64__)) || \
>       defined(__powerpc64__) || \
>       (defined(sgi) && (_MIPS_SZLONG == 64))
>   #define LONG64
>


-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc


More information about the xorg-devel mailing list