4 ms·
I'm not sure how well this works, but Nimbus (iOS framework) lets you embed itself in your own static library with a custom prefix via preprocessor macros. It w
by buddydvd 14y ago
I'm not sure how well this works, but Nimbus (iOS framework) lets you embed itself in your own static library with a custom prefix via preprocessor macros. It would helpful if more libraries provide this feature.
http://wiki.nimbuskit.info/Nimbus-Namespacing http://wiki.nimbuskit.info/Nimbus-Namespacing
- barumrho 14y agoThis file seems to do the trick. Using macros to override class names. https://github.com/jverkoey/nimbus/blob/master/src/core/src/NimbusCore%2BNamespace.h https://github.com/jverkoey/nimbus/blob/master/src/core/src/...
- buddydvd 14y agoThe framework is divided into modules. For each module you include in your static lib (even the ones that gets added indirectly), you need to add its namespace header file. The file you linked to is the namespace header for the Core module. There are more. Perhaps this could be avoided by just replacing all class names with macros (e.g. _N(NILinkedList)), though that might hinder code completion.
- pooriaazimi 14y agoI'm getting more confused. Using #if... requires recompilation, doesn't it? So how can a library use them? Now that I think about it, I see that I don't have any idea how 'dylib's work... I should look them up.
- buddydvd 14y agoIf you are building your own static library and would like to distribute Nimbus with it, this feature allows you to add a prefix to all Nimbus classes without having you to manually rename them. This lets users of your static lib free to include Nimbus with their project without triggering a name conflict with the one included with your lib.