This is kind of a strange question. Basically there’s a const struct defined in a framework that I may or may not be able to load. Let’s say the struct is called “ExternalStruct”. I can tell whether or not I can load the framework but I can’t use the variable by name because if I can’t load the framework it will crash. How can I do what I’m trying to do (reference ExternalStruct but only if I can load this framework)?
Thanks
EDIT:
My other thought was to use an ifdef but I’m not sure how those work with respect to compile time vs link time.
If you can get the CFBundle/NSBundle for the library in question, once it’s loaded you can use CFBundleGetDataPointerForName.