Define _ILP32 and __ILP32__ for x32
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 13 Apr 2012 18:20:10 +0000 (18:20 +0000)
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 13 Apr 2012 18:20:10 +0000 (18:20 +0000)
* config/i386/i386-c.c (ix86_target_macros): Define _ILP32
and __ILP32__ for x32.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186429 138bc75d-0d04-0410-961f-82ee72b054a4

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

index e04d1be..bf62906 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 8adb3b4..49fd4d9 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
     {