• 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
[OT] Re: Using assembly in objective-c
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OT] Re: Using assembly in objective-c


  • Subject: [OT] Re: Using assembly in objective-c
  • From: Alastair Houghton <email@hidden>
  • Date: Tue, 22 Jan 2008 13:18:31 +0000

On 22 Jan 2008, at 00:26, Twisted Theory Software wrote:

On 21 Jan, 2008, at 5:00 PM, Andrew Farmer wrote:

For the sake of brevity, I'll give a general answer. [Insert a bunch of dire warnings about using private frameworks here.] A C(*) function called xyzzy() will generate a symbol named _xyzzy. It can be called by simply declaring and calling a function called xyzzy(); no wrapper (or assembly!) is necessary.

Yes, but you still have to link against some library containing xyzzy(). For the function I'm after is located in HIServices.framework, but linking against ApplicationServices.framework, its umbrella, results in a symbol not found error. This worked before, on Tiger, when they were seperate frameworks.

What I'm asking is can I use the assembly from the HIServices library (the binary file) in a function. If so, how?


If you have the code, you can read it to work out what it does, then write equivalent C code (or, if you *really* want, include it as inline assembly). Most likely this approach won't work, however, because it very probably calls other routines and/or uses other symbols in the HIServices framework. It would only really work in trivial cases.

If there isn't a supported way to do what you want, as others have said already, you should file a bug report asking for one. The reason the linker prevents you from linking against subframeworks is precisely so that you can't easily call SPIs; doing that makes Apple's job much harder because it can create compatibility issues where none should exist. Sometimes they may be able to get application developers to address these, but on other occasions they will end up having to add gross workarounds to Mac OS X itself, which is *nasty*.

In any case, this question is off-topic, because it isn't about Cocoa.

Kind regards,

Alastair.

--
http://alastairs-place.net



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Using assembly in objective-c (From: Twisted Theory Software <email@hidden>)
 >Re: Using assembly in objective-c (From: glenn andreas <email@hidden>)
 >Re: Using assembly in objective-c (From: Twisted Theory Software <email@hidden>)
 >Re: Using assembly in objective-c (From: "Kyle Sluder" <email@hidden>)
 >Re: Using assembly in objective-c (From: Twisted Theory Software <email@hidden>)
 >Re: Using assembly in objective-c (From: Andrew Farmer <email@hidden>)
 >Re: Using assembly in objective-c (From: Twisted Theory Software <email@hidden>)

  • Prev by Date: Re: AW: leopard: No universal libjpeg.dylib in 10.4SDK?
  • Next by Date: Re: AW: leopard: No universal libjpeg.dylib in 10.4SDK?
  • Previous by thread: Re: Using assembly in objective-c
  • Next by thread: NSURL loadResourceDataNotifyingClient callbacks never called when -fobjc-gc is used
  • Index(es):
    • Date
    • Thread