summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/services.h14
-rw-r--r--src/modulemanager.cpp8
2 files changed, 11 insertions, 11 deletions
diff --git a/include/services.h b/include/services.h
index 43e91a21b..ae36f8dbd 100644
--- a/include/services.h
+++ b/include/services.h
@@ -158,12 +158,12 @@ extern int strncasecmp(const char *, const char *, size_t);
/** This definition is used as shorthand for the various classes
* and functions needed to make a module loadable by the OS.
- * It defines the class factory and external init_module function.
+ * It defines the class factory and external AnopeInit and AnopeFini functions.
*/
#ifdef _WIN32
#define MODULE_INIT(x) \
- extern "C" DllExport Module *init_module(const std::string &, const std::string &); \
- extern "C" Module *init_module(const std::string &modname, const std::string &creator) \
+ extern "C" DllExport Module *AnopeInit(const std::string &, const std::string &); \
+ extern "C" Module *AnopeInit(const std::string &modname, const std::string &creator) \
{ \
return new x(modname, creator); \
} \
@@ -177,19 +177,19 @@ extern int strncasecmp(const char *, const char *, size_t);
} \
return TRUE; \
} \
- extern "C" DllExport void destroy_module(x *); \
- extern "C" void destroy_module(x *m) \
+ extern "C" DllExport void AnopeFini(x *); \
+ extern "C" void AnopeFini(x *m) \
{ \
delete m; \
}
#else
#define MODULE_INIT(x) \
- extern "C" DllExport Module *init_module(const std::string &modname, const std::string &creator) \
+ extern "C" DllExport Module *AnopeInit(const std::string &modname, const std::string &creator) \
{ \
return new x(modname, creator); \
} \
- extern "C" DllExport void destroy_module(x *m) \
+ extern "C" DllExport void AnopeFini(x *m) \
{ \
delete m; \
}
diff --git a/src/modulemanager.cpp b/src/modulemanager.cpp
index a9f1eb2f0..18ab2bda4 100644
--- a/src/modulemanager.cpp
+++ b/src/modulemanager.cpp
@@ -164,10 +164,10 @@ int ModuleManager::LoadModule(const std::string &modname, User * u)
}
ano_modclearerr();
- func = function_cast<Module *(*)(const std::string &, const std::string &)>(dlsym(handle, "init_module"));
+ func = function_cast<Module *(*)(const std::string &, const std::string &)>(dlsym(handle, "AnopeInit"));
if (func == NULL && (err = dlerror()) != NULL)
{
- Alog() << "No magical init function found, not an Anope module";
+ Alog() << "No init function found, not an Anope module";
dlclose(handle);
return MOD_ERR_NOLOAD;
}
@@ -292,10 +292,10 @@ void ModuleManager::DeleteModule(Module *m)
handle = m->handle;
ano_modclearerr();
- destroy_func = function_cast<void (*)(Module *)>(dlsym(m->handle, "destroy_module"));
+ destroy_func = function_cast<void (*)(Module *)>(dlsym(m->handle, "AnopeFini"));
if (destroy_func == NULL && (err = dlerror()) != NULL)
{
- Alog() << "No magical destroy function found, chancing delete...";
+ Alog() << "No destroy function found, chancing delete...";
delete m; /* we just have to chance they haven't overwrote the delete operator then... */
}
else