* config/rs6000/rs6000.h (RS6000_CPU_CPP_ENDIAN_BUILTINS): New.
* config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Use
RS6000_CPU_CPP_ENDIAN_BUILTINS.
* config/rs6000/netbsd.h (RS6000_CPU_CPP_ENDIAN_BUILTINS): Redefine.
From-SVN: r59518
+2002-11-26 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * config/rs6000/rs6000.h (RS6000_CPU_CPP_ENDIAN_BUILTINS): New.
+ * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Use
+ RS6000_CPU_CPP_ENDIAN_BUILTINS.
+ * config/rs6000/netbsd.h (RS6000_CPU_CPP_ENDIAN_BUILTINS): Redefine.
+
2002-11-26 Hartmut Penner <hpenner@de.ibm.com>
* config/s390/s390.md (literal_pool_64, literal_pool_31 ): New
} \
while (0)
+/* Override the default from rs6000.h to avoid conflicts with macros
+ defined in NetBSD header files. */
+
+#undef RS6000_CPU_CPP_ENDIAN_BUILTINS
+#define RS6000_CPU_CPP_ENDIAN_BUILTINS() \
+ do \
+ { \
+ if (BYTES_BIG_ENDIAN) \
+ { \
+ builtin_define ("__BIG_ENDIAN__"); \
+ builtin_assert ("machine=bigendian"); \
+ } \
+ else \
+ { \
+ builtin_define ("__LITTLE_ENDIAN__"); \
+ builtin_assert ("machine=littleendian"); \
+ } \
+ } \
+ while (0)
+
/* Make GCC agree with <machine/ansi.h>. */
#undef SIZE_TYPE
/* Used by lwarx/stwcx. errata work-around. */
if (rs6000_cpu == PROCESSOR_PPC405)
builtin_define ("__PPC405__");
- if (BYTES_BIG_ENDIAN)
- {
- builtin_define ("__BIG_ENDIAN__");
- builtin_define ("_BIG_ENDIAN");
- builtin_assert ("machine=bigendian");
- }
- else
- {
- builtin_define ("__LITTLE_ENDIAN__");
- builtin_define ("_LITTLE_ENDIAN");
- builtin_assert ("machine=littleendian");
- }
+
+ /* May be overridden by target configuration. */
+ RS6000_CPU_CPP_ENDIAN_BUILTINS();
+
if (TARGET_LONG_DOUBLE_128)
builtin_define ("__LONG_DOUBLE_128__");
/* Target #defines. */
#define TARGET_CPU_CPP_BUILTINS() \
rs6000_cpu_cpp_builtins (pfile)
+
+/* This is used by rs6000_cpu_cpp_builtins to indicate the byte order
+ we're compiling for. Some configurations may need to override it. */
+#define RS6000_CPU_CPP_ENDIAN_BUILTINS() \
+ do \
+ { \
+ if (BYTES_BIG_ENDIAN) \
+ { \
+ builtin_define ("__BIG_ENDIAN__"); \
+ builtin_define ("_BIG_ENDIAN"); \
+ builtin_assert ("machine=bigendian"); \
+ } \
+ else \
+ { \
+ builtin_define ("__LITTLE_ENDIAN__"); \
+ builtin_define ("_LITTLE_ENDIAN"); \
+ builtin_assert ("machine=littleendian"); \
+ } \
+ } \
+ while (0)
\f
/* Target machine storage layout. */