From 833fe7dadc06faaeefb7812a69dcc9a178543184 Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Wed, 5 Dec 2012 21:10:18 +0000 Subject: [PATCH] re PR target/54160 (gcc should not define __OBJC2__ when lang is not set to ObjC (gcc 4.6 and later)) PR target/54160 * config/t-darwin (darwin-c.o): Depend on $(CPP_INTERNAL_H). * config/darwin-c.c (darwin_cpp_builtins): Only set __OBJC2__ when in obj mode. Include libcpp/internal.h. From-SVN: r194227 --- gcc/ChangeLog | 8 ++++++++ gcc/config/darwin-c.c | 3 ++- gcc/config/t-darwin | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c261541e6ee..652c05f75f5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2012-12-05 Aldy Hernandez + + PR target/54160 + * config/t-darwin (darwin-c.o): Depend on $(CPP_INTERNAL_H). + * config/darwin-c.c (darwin_cpp_builtins): Only set __OBJC2__ when + in obj mode. + Include libcpp/internal.h. + 2012-12-05 Michael Eager PR rtl-optimization/54739 diff --git a/gcc/config/darwin-c.c b/gcc/config/darwin-c.c index 8e48c30575a..ec8aa9ccf09 100644 --- a/gcc/config/darwin-c.c +++ b/gcc/config/darwin-c.c @@ -38,6 +38,7 @@ along with GCC; see the file COPYING3. If not see #include "c-family/c-target.h" #include "c-family/c-target-def.h" #include "cgraph.h" +#include "../../libcpp/internal.h" /* Pragmas. */ @@ -632,7 +633,7 @@ darwin_cpp_builtins (cpp_reader *pfile) builtin_define ("__weak="); } - if (flag_objc_abi == 2) + if (CPP_OPTION (pfile, objc) && flag_objc_abi == 2) builtin_define ("__OBJC2__"); } diff --git a/gcc/config/t-darwin b/gcc/config/t-darwin index e2bd74d61b0..0e8346b6a89 100644 --- a/gcc/config/t-darwin +++ b/gcc/config/t-darwin @@ -29,7 +29,7 @@ darwin.o: $(srcdir)/config/darwin.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ darwin-c.o: $(srcdir)/config/darwin-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(TM_H) $(CPPLIB_H) $(TREE_H) $(C_PRAGMA_H) $(TM_P_H) \ - incpath.h flags.h $(C_COMMON_H) $(C_TARGET_H) $(C_TARGET_DEF_H) + incpath.h flags.h $(C_COMMON_H) $(C_TARGET_H) $(C_TARGET_DEF_H) $(CPP_INTERNAL_H) $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ $(srcdir)/config/darwin-c.c $(PREPROCESSOR_DEFINES) -- 2.30.2