Is there any way to determine whether the Accelerate.framework is available at runtime from straight C or C++ files?
The examples I’ve found for conditional coding all seem to require Objective-C introspection (e.g., respondsToSelector) and/or Objective-C apis (e.g., UIDevice’s systemVersion member)
The usual trick for this is that you weak link against the framework and then check a function pointer exported by that framework for the actual availability. If the framework failed to link because it is not available then the function will be
NULL.So for
Accelerate.frameworkyou would do something like this:This is described in TN2064 – Ensuring Binary Backwards Compatibility