[patch] PR target/54160: Only set __OBJC2__ when compiling OBJC.
Aldy Hernandez
aldyh@redhat.com
Wed Dec 5 18:22:00 GMT 2012
Adjusted ChangeLog entry as suggested by Jakub on IRC.
OK?
-------------- next part --------------
commit ddc4494409331e5a75814a6c8a57aa0646257fb2
Author: Aldy Hernandez <aldyh@redhat.com>
Date: Wed Dec 5 08:38:10 2012 -0600
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.
diff --git a/gcc/config/darwin-c.c b/gcc/config/darwin-c.c
index 8e48c30..ec8aa9c 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 e2bd74d..0e8346b 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)
More information about the Gcc-patches
mailing list