Re: CFBundleGetFunctionPointerForName
Re: CFBundleGetFunctionPointerForName
- Subject: Re: CFBundleGetFunctionPointerForName
- From: Chris Espinosa <email@hidden>
- Date: Thu, 13 Mar 2008 11:57:06 -0700
On Mar 13, 2008, at 11:43 AM, Alastair Houghton wrote: On 13 Mar 2008, at 18:32, Steve Checkoway wrote:
On Mar 13, 2008, at 9:09 AM, Sherm Pendley wrote:
In my experience, CFBundleGetFunctionPointerForName wants symbols to be
prefixed with an underscore - that is, _model_call. They're stored that way
in the binary (it's a C thing) and the function doesn't appear to add it for
you before searching.
I'm pretty sure it is not a C thing and that nothing is mentioned in the standard.
Linux, for example, does not prefix its symbols with underscores. I'm pretty sure it's just Mac thing.
IIRC it's an assembler thing. It happens because the native assemblers on some systems don't require any prefix when talking about registers, which would interfere with C symbols with similar names (e.g. you couldn't have a global called "d0" on some 68K platforms without the '_' prefixes).
A *lot* of platforms use the '_' prefix convention for this reason. OTOH I don't recall whether Linux is one of them; some platforms hide the '_' prefixes from their dynamic linker APIs.
The leading underscore is C name mangling, as opposed to C++ name mangling that uses leading double underscores. It allows the compiler to distinguish user
The C and C++ standards are silent on these issues, but the underscore conventions are industrywide.
Chris |
_______________________________________________
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