This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH/RFA] rs6000: TARGET_CPU_CPP_BUILTINS tweak


On Mon, Nov 25, 2002 at 09:28:38PM -0500, David Edelsohn wrote:

 > 	How does _BIG_ENDIAN and _LITTLE_ENDIAN conflict with NetBSD?
 > Those symbols are in the protected namespace.

NetBSD's <sys/endian.h> does:

.
.
.

/* 
 * Definitions for byte order, according to byte significance from low
 * address to high.
 */   
#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 */

#include <machine/endian_machdep.h>
 
/*      
 * Define the order of 32-bit words in 64-bit words.
 */   
#if _BYTE_ORDER == _LITTLE_ENDIAN
#define _QUAD_HIGHWORD 1
#define _QUAD_LOWWORD 0
#endif 
 
#if _BYTE_ORDER == _BIG_ENDIAN
#define _QUAD_HIGHWORD 0
#define _QUAD_LOWWORD 1
#endif

.
.
.

These macros are tested in various public header files, and are defined
as such precisely because they are in the protected namespace, and thus
safe to include in those other public header files.

-- 
        -- Jason R. Thorpe <thorpej@wasabisystems.com>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]