diff mbox

PATCH: Define _ILP32 and __ILP32__ for x32

Message ID 20120413171456.GA17593@intel.com
State New
Headers show

Commit Message

H.J. Lu April 13, 2012, 5:14 p.m. UTC
Hi,

This patch defines _ILP32 and __ILP32__ for x32 as specified by x32 psABI.
OK for trunk and 4.7 branch?

Thanks.

H.J.
---
2012-04-13  H.J. Lu  <hongjiu.lu@intel.com>

	* config/i386/i386-c.c (ix86_target_macros): Define _ILP32
	and __ILP32__ for x32.

Comments

Uros Bizjak April 13, 2012, 6:05 p.m. UTC | #1
On Fri, Apr 13, 2012 at 7:14 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:

> This patch defines _ILP32 and __ILP32__ for x32 as specified by x32 psABI.
> OK for trunk and 4.7 branch?

>        * config/i386/i386-c.c (ix86_target_macros): Define _ILP32
>        and __ILP32__ for x32.

OK.

Thanks,
Uros.
diff mbox

Patch

diff --git a/gcc/config/i386/i386-c.c b/gcc/config/i386/i386-c.c
index 8adb3b4..49fd4d9 100644
--- a/gcc/config/i386/i386-c.c
+++ b/gcc/config/i386/i386-c.c
@@ -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
     {