This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [bfin] Define __bfin__ and __BFIN__


Joseph S. Myers wrote:
On Thu, 26 Oct 2006, Jie Zhang wrote:

This patch add __bfin__ and __BFIN__ to bfin port gcc predefined macros. This
is demanded by
building newlib outside of gcc source tree. Currently newlib use BFIN macro to
enclose source code
specific to Blackfin. fixincludes will fix these macros in newlib header files
by replacing them
with __BFIN__, which is not defined by gcc.

The correct approach is to change builtin_define ("bfin") to builtin_define_std ("bfin"). Every target use of builtin_define with a name not in the reserved namespace is a bug (unless conditioned not to be used if flag_iso): bug 545.


Good point! Thanks.

Here is the revised patch.

Jie

	* config/bfin/bfin.h (TARGET_CPU_CPP_BUILTINS): Use builtin_define_std
	instead of builtin_define for bfin and BFIN.

Index: config/bfin/bfin.h
===================================================================
--- config/bfin/bfin.h	(revision 118022)
+++ config/bfin/bfin.h	(working copy)
@@ -39,8 +39,8 @@
 #define TARGET_CPU_CPP_BUILTINS()               \
   do                                            \
     {                                           \
-      builtin_define ("bfin");                  \
-      builtin_define ("BFIN");                  \
+      builtin_define_std ("bfin");              \
+      builtin_define_std ("BFIN");              \
       builtin_define ("__ADSPBLACKFIN__");	\
       if (TARGET_FDPIC)				\
 	builtin_define ("__BFIN_FDPIC__");	\

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]