rs6000.h (RS6000_CPU_CPP_ENDIAN_BUILTINS): New.
authorJason Thorpe <thorpej@wasabisystems.com>
Tue, 26 Nov 2002 15:46:40 +0000 (15:46 +0000)
committerJason Thorpe <thorpej@gcc.gnu.org>
Tue, 26 Nov 2002 15:46:40 +0000 (15:46 +0000)
* 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

gcc/ChangeLog
gcc/config/rs6000/netbsd.h
gcc/config/rs6000/rs6000-c.c
gcc/config/rs6000/rs6000.h

index fd2047ecfc53a54813837f6a3c7673f5a42aab47..51b1e88b43fd619f4b095a0b281963515982600a 100644 (file)
@@ -1,3 +1,10 @@
+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
index 6791a4d6622f2d22e301d37c475c81106008acde..b473a8a868fe0e507cf9951fc4f3101db5d10717 100644 (file)
@@ -31,6 +31,26 @@ Boston, MA 02111-1307, USA.  */
     }                                          \
   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
index 6093996a132539a754c90bcd1f3e68848d3d0ecd..03f91baf2c7e32118b55b4d1ffe0545b9d3cfd23 100644 (file)
@@ -100,18 +100,10 @@ rs6000_cpu_cpp_builtins (pfile)
   /* 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__");
 
index 5771a9c46d7f0001649e346f550499af22d18099..ab38f5693eb740de512a71f1775e57aac0370f31 100644 (file)
@@ -479,6 +479,26 @@ extern int rs6000_default_long_calls;
 /* 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.  */