GCC style weak linking in Visual Studio?

You can do it, here is an example in C: /* * pWeakValue MUST be an extern const variable, which will be aliased to * pDefaultWeakValue if no real user definition is present, thanks to the * alternatename directive. */ extern const char * pWeakValue; extern const char * pDefaultWeakValue = NULL; #pragma comment(linker, “/alternatename:_pWeakValue=_pDefaultWeakValue”)

Weak Linking – check if a class exists and use that class

TLDR Current: Swift: if #available(iOS 9, *) Obj-C, iOS: if (@available(iOS 11.0, *)) Obj-C, OS X: if (NSClassFromString(@”UIAlertController”)) Legacy: Swift (versions prior to 2.0): if objc_getClass(“UIAlertController”) Obj-C, iOS (versions prior to 4.2): if (NSClassFromString(@”UIAlertController”)) Obj-C, iOS (versions prior to 11.0): if ([UIAlertController class]) Swift 2+ Although historically it’s been recommended to check for capabilities (or … Read more