• 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: Inline function - multiple includes during link
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inline function - multiple includes during link


  • Subject: Re: Inline function - multiple includes during link
  • From: Steve Sisak <email@hidden>
  • Date: Wed, 14 Feb 2007 21:25:55 -0500

At 2:09 PM -0800 2/14/07, George Lawrence Storm wrote:
If I change:

#define __inline __inline__

to:

#define __inline extern __inline__

It will compile and link, however by doing this I assume I never actually define the function.

Assuming this is C++, try:

#define __inline inline

While "inline" isn't guaranteed to inline a function, it is guaranteed not to generate a link error if there are multiple definitions.

If you don't care about multiple copies of the code if the function is not inlined,

#define __inline static inline

will also work.

HTH,

-Steve
_______________________________________________
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: 
 >Inline function - multiple includes during link (From: George Lawrence Storm <email@hidden>)

  • Prev by Date: Re: Linker refuses to link my dylib? Why?
  • Next by Date: Building UB given an Intel and PPC library
  • Previous by thread: Inline function - multiple includes during link
  • Next by thread: Building UB given an Intel and PPC library
  • Index(es):
    • Date
    • Thread