• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: 4 vs 8 alignment
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 4 vs 8 alignment


  • Subject: Re: 4 vs 8 alignment
  • From: "Sean McBride" <email@hidden>
  • Date: Wed, 13 Dec 2006 11:47:48 -0500
  • Organization: Rogue Research

On 2006-12-13 11:32, David Fang said:

>	'Portable' wasn't the right term.  Yes, it is a GNU (and others)
>extension.  I meant that it's easier to disable __attribute__(...) where
>it is unsupported by #define-ing it to something empty, whereas #pragma
>may not necessarily be "cancel-able", since they are typically
>compiler-specific.  Consider:

Ah, I see.  Makes good sense, thanks for the explanation.

>// suppose you do detect attribute support in an autoconf-fashion:
>#if HAVE_ATTRIBUTE_FOO
>#define	__ATTRIBUTE_FOO__		__attribute__((foo))
>#else
>#define	__ATTRIBUTE_FOO__
>// no-effect
>#endif

And Apple does just this, for example in AvailabilityMacros.h:

#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) &&
(__GNUC_MINOR__ >= 1))) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020)
    #define WEAK_IMPORT_ATTRIBUTE __attribute__((weak_import))
#elif defined(__MWERKS__) && (__MWERKS__ >= 0x3205) &&
(MAC_OS_X_VERSION_MIN_REQUIRED >= 1020)
    #define WEAK_IMPORT_ATTRIBUTE __attribute__((weak_import))
#else
    #define WEAK_IMPORT_ATTRIBUTE
#endif

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: 4 vs 8 alignment (From: "Sean McBride" <email@hidden>)
 >Re: 4 vs 8 alignment (From: David Fang <email@hidden>)

  • Prev by Date: Re: 4 vs 8 alignment
  • Next by Date: Re: duplicated headers
  • Previous by thread: Re: 4 vs 8 alignment
  • Next by thread: Re: 4 vs 8 alignment
  • Index(es):
    • Date
    • Thread