Date: Thu, 30 Oct 2008 03:31:33 +0000 (UTC) From: Marcel Moolenaar <marcel@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r184460 - head/sys/powerpc/include Message-ID: <200810300331.m9U3VX3k040363@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: marcel Date: Thu Oct 30 03:31:33 2008 New Revision: 184460 URL: http://svn.freebsd.org/changeset/base/184460 Log: Add support for little-endian compilations to this file. Modified: head/sys/powerpc/include/endian.h Modified: head/sys/powerpc/include/endian.h ============================================================================== --- head/sys/powerpc/include/endian.h Thu Oct 30 01:54:31 2008 (r184459) +++ head/sys/powerpc/include/endian.h Thu Oct 30 03:31:33 2008 (r184460) @@ -44,15 +44,29 @@ #define _QUAD_LOWWORD 1 /* + * GCC defines _BIG_ENDIAN and _LITTLE_ENDIAN equal to __BIG_ENDIAN__ + * and __LITTLE_ENDIAN__ (resp). + */ +#ifdef _BIG_ENDIAN +#undef _BIG_ENDIAN +#endif +#ifdef _LITTLE_ENDIAN +#undef _LITTLE_ENDIAN +#endif + +/* * Definitions for byte order, according to byte significance from low * address to high. */ -#undef _BIG_ENDIAN /* GCC annoyingly defines this for PowerPC */ #define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ #define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ #define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ +#ifdef __LITTLE_ENDIAN__ +#define _BYTE_ORDER _LITTLE_ENDIAN +#else #define _BYTE_ORDER _BIG_ENDIAN +#endif /* * Deprecated variants that don't have enough underscores to be useful in more
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810300331.m9U3VX3k040363>