Module ABI: Use a string pointer

Returning a const char* is way easier, makes way more sense and is way
friendlier for an extern "C" function.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1661 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2009-11-15 13:29:17 +00:00
parent aa32e1f3bb
commit d96d16634b
+4 -4
View File
@@ -45,13 +45,13 @@ typedef void* ModHandle;
#define MODULEDEFS(CLASS, DESCRIPTION) \
extern "C" { \
/* First the definitions to shut up some compiler warnings */ \
CString ZNCModDescription(); \
const char *ZNCModDescription(); \
bool ZNCModGlobal(); \
double ZNCModVersion(); \
CModule* ZNCModLoad(ModHandle p, CUser* pUser, const CString& sModName, \
const CString& sModPath); \
void ZNCModUnload(CModule* pMod); \
CString ZNCModDescription() { return DESCRIPTION; } \
const char *ZNCModDescription() { return DESCRIPTION; } \
bool ZNCModGlobal() { return false; } \
double ZNCModVersion() { return VERSION; } \
CModule* ZNCModLoad(ModHandle p, CUser* pUser, const CString& sModName, \
@@ -68,13 +68,13 @@ typedef void* ModHandle;
#define GLOBALMODULEDEFS(CLASS, DESCRIPTION) \
extern "C" { \
/* First the definitions to shut up some compiler warnings */ \
CString ZNCModDescription(); \
const char *ZNCModDescription(); \
bool ZNCModGlobal(); \
double ZNCModVersion(); \
CGlobalModule* ZNCModLoad(ModHandle p, const CString& sModName, \
const CString& sModPath); \
void ZNCModUnload(CGlobalModule* pMod); \
CString ZNCModDescription() { return DESCRIPTION; } \
const char *ZNCModDescription() { return DESCRIPTION; } \
bool ZNCModGlobal() { return true; } \
double ZNCModVersion() { return VERSION; } \
CGlobalModule* ZNCModLoad(ModHandle p, const CString& sModName, \