Add a macro that allows exported functions to use different names

develop
lethosor 2015-05-09 09:42:15 -04:00
parent a8f5e683f7
commit b6ec48c99a
1 changed files with 2 additions and 1 deletions

@ -237,7 +237,8 @@ namespace DFHack
std::map<std::string, void**> bindings; std::map<std::string, void**> bindings;
bool bind(DFLibrary* lib); bool bind(DFLibrary* lib);
}; };
#define PLUGIN_EXPORT_BIND(name) bindings.insert(std::pair<std::string, void**>(#name, (void**)&this->name)) #define PLUGIN_EXPORT_BIND(sym) bindings.insert(std::pair<std::string, void**>(#sym, (void**)&this->sym))
#define PLUGIN_EXPORT_BINDN(sym, name) bindings.insert(std::pair<std::string, void**>(name, (void**)&this->sym))
class DFHACK_EXPORT PluginManager class DFHACK_EXPORT PluginManager
{ {
// PRIVATE METHODS // PRIVATE METHODS