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: fix __attribute__ for apple broken cpp


>>>>> "Aldy" == Aldy Hernandez <aldyh@redhat.com> writes:

 > another patch from the stubbort department.
 > darwin's cpp expands ATTRIBUTE_UNUSED* macros incorrectly.  here is a patch 
 > to fix it.  i'm really hoping later releases of the apple development tools
 > will have the preprocessor fixed.

Sorry wrong patch.  Here's the real one :)

ok?

2002-01-03  Aldy Hernandez  <aldyh@redhat.com>

        * include/ansidecl.h: Define __attribute__ empty for older
        versions of Apple's cc.

Index: ansidecl.h
===================================================================
RCS file: /cvs/gcc/gcc/include/ansidecl.h,v
retrieving revision 1.13
diff -c -p -r1.13 ansidecl.h
*** ansidecl.h	2001/08/29 19:44:39	1.13
--- ansidecl.h	2002/01/04 16:29:55
*************** So instead we use the macro below and te
*** 239,244 ****
--- 239,253 ----
  # define __attribute__(x)
  #endif
  
+ /* Note: some versions of MacOS X claim to be gcc, but have a hacked
+    up preprocessor which will miscompile attributes.  */
+ 
+ #ifdef __APPLE_CC__
+ #if (__APPLE_CC__ < 950)
+ #define __attribute__(x)
+ #endif
+ #endif
+ 
  /* Attribute __malloc__ on functions was valid as of gcc 2.96. */
  #ifndef ATTRIBUTE_MALLOC
  # if (GCC_VERSION >= 2096)


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