Define _ILP32 and __ILP32__ for x32
authorH.J. Lu <hongjiu.lu@intel.com>
Fri, 13 Apr 2012 18:20:10 +0000 (18:20 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Fri, 13 Apr 2012 18:20:10 +0000 (11:20 -0700)
* config/i386/i386-c.c (ix86_target_macros): Define _ILP32
and __ILP32__ for x32.

From-SVN: r186429

gcc/ChangeLog
gcc/config/i386/i386-c.c

index e04d1be979ceabbe1a3ed408efc955dff47c7f37..bf62906e30cc5c86694a1d102f14c2b8bc988fc5 100644 (file)
@@ -1,3 +1,8 @@
+2012-04-13  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * config/i386/i386-c.c (ix86_target_macros): Define _ILP32
+       and __ILP32__ for x32.
+
 2012-04-13  Martin Jambor  <mjambor@suse.cz>
 
        PR middle-end/52939
index 8adb3b46dfaf414258480e8c612fe462590d678a..49fd4d92ca8804d6dd2a5b7099bd233eb74a2353 100644 (file)
@@ -383,6 +383,11 @@ ix86_target_macros (void)
       cpp_define (parse_in, "__amd64__");
       cpp_define (parse_in, "__x86_64");
       cpp_define (parse_in, "__x86_64__");
+      if (TARGET_X32)
+       {
+         cpp_define (parse_in, "_ILP32");
+         cpp_define (parse_in, "__ILP32__");
+       }
     }
   else
     {