mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Hide every symbol except ZNCModInfo from modules.
This means that now it's possible to have the same class names in different modules, which reduces chances of weird errors. Thanks to mclc for noticing this.
This commit is contained in:
@@ -53,9 +53,15 @@ template<class M> CGlobalModule* TModLoadGlobal(ModHandle p,
|
||||
return new M(p, sModName, sModPath);
|
||||
}
|
||||
|
||||
#if HAVE_VISIBILITY
|
||||
# define MODULE_EXPORT __attribute__((__visibility__("default")))
|
||||
#else
|
||||
# define MODULE_EXPORT
|
||||
#endif
|
||||
|
||||
#define MODCOMMONDEFS(CLASS, DESCRIPTION, GLOBAL, LOADER) \
|
||||
extern "C" { \
|
||||
bool ZNCModInfo(double dCoreVersion, CModInfo& Info); \
|
||||
MODULE_EXPORT bool ZNCModInfo(double dCoreVersion, CModInfo& Info); \
|
||||
bool ZNCModInfo(double dCoreVersion, CModInfo& Info) { \
|
||||
if (dCoreVersion != VERSION) \
|
||||
return false; \
|
||||
|
||||
@@ -28,6 +28,7 @@ AC_PROG_GREP
|
||||
AC_PROG_SED
|
||||
AC_CANONICAL_HOST
|
||||
AC_SYS_LARGEFILE
|
||||
gl_VISIBILITY
|
||||
|
||||
appendLib () {
|
||||
if test "$LIBS" != ""; then
|
||||
@@ -268,6 +269,7 @@ AC_ARG_WITH( [module-data-prefix],
|
||||
[DATADIR="${datadir}/znc"] )
|
||||
|
||||
appendMod "$CXXFLAGS"
|
||||
appendMod "$CFLAG_VISIBILITY"
|
||||
|
||||
if test -z "$ISSUN" -a -z "$ISDARWIN" -a -z "$ISCYGWIN"; then
|
||||
# This is an unknown compiler flag on some OS
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
|
||||
#include "Modules.h"
|
||||
|
||||
#if HAVE_VISIBILITY
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
class CPerlModule : public CModule {
|
||||
CString m_sPerlID;
|
||||
VWebSubPages* _GetSubPages();
|
||||
@@ -171,3 +174,6 @@ inline double GetVersion() {
|
||||
inline CString GetVersionExtra() {
|
||||
return VERSION_EXTRA;
|
||||
}
|
||||
#if HAVE_VISIBILITY
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
@@ -15,6 +15,9 @@ public:
|
||||
|
||||
class CModPython;
|
||||
|
||||
#if HAVE_VISIBILITY
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
class CPyModule : public CModule {
|
||||
PyObject* m_pyObj;
|
||||
CModPython* m_pModPython;
|
||||
@@ -224,3 +227,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
#if HAVE_VISIBILITY
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user