diff --git a/libxml++/exceptions/exception.h b/libxml++/exceptions/exception.h index e6b3d97a..7a657222 100644 --- a/libxml++/exceptions/exception.h +++ b/libxml++/exceptions/exception.h @@ -36,17 +36,17 @@ namespace xmlpp /** Base class for all xmlpp exceptions. */ -class exception : public std::exception +class LIBXMLPP_VISIBILITY_DEFAULT exception : public std::exception { public: - LIBXMLPP_API + LIBXMLPP_MEMBER_METHOD explicit exception(const ustring& message); - LIBXMLPP_API ~exception() noexcept override; + LIBXMLPP_MEMBER_METHOD ~exception() noexcept override; - LIBXMLPP_API const char* what() const noexcept override; + LIBXMLPP_MEMBER_METHOD const char* what() const noexcept override; - LIBXMLPP_API virtual void raise() const; - LIBXMLPP_API virtual exception* clone() const; + LIBXMLPP_MEMBER_METHOD virtual void raise() const; + LIBXMLPP_MEMBER_METHOD virtual exception* clone() const; private: ustring message_; diff --git a/libxml++config.h.in b/libxml++config.h.in index cfa46e4d..4310c295 100755 --- a/libxml++config.h.in +++ b/libxml++config.h.in @@ -24,6 +24,10 @@ #ifdef LIBXMLPP_DLL #ifdef LIBXMLPP_BUILD #define LIBXMLPP_API __declspec(dllexport) + #ifdef __GNUC__ + #define LIBXMLPP_VISIBILITY_DEFAULT __attribute__((visibility("default"))) + #define LIBXMLPP_MEMBER_METHOD + #endif #elif !defined (__GNUC__) #define LIBXMLPP_API __declspec(dllimport) #else /* don't dllimport classes/methods on GCC/MinGW */ @@ -34,5 +38,12 @@ #define LIBXMLPP_API #endif /* GLIBMM_DLL */ +#ifndef LIBXMLPP_VISIBILITY_DEFAULT + #define LIBXMLPP_VISIBILITY_DEFAULT +#endif +#ifndef LIBXMLPP_MEMBER_METHOD + #define LIBXMLPP_MEMBER_METHOD LIBXMLPP_API +#endif + #endif /* _LIBXMLPP_CONFIG_H */ diff --git a/libxml++config.h.meson b/libxml++config.h.meson index 2a5f03b2..d1b06ccb 100755 --- a/libxml++config.h.meson +++ b/libxml++config.h.meson @@ -26,6 +26,10 @@ #ifdef LIBXMLPP_DLL #ifdef LIBXMLPP_BUILD #define LIBXMLPP_API __declspec(dllexport) + #ifdef __GNUC__ + #define LIBXMLPP_VISIBILITY_DEFAULT __attribute__((visibility("default"))) + #define LIBXMLPP_MEMBER_METHOD + #endif #elif !defined (__GNUC__) #define LIBXMLPP_API __declspec(dllimport) #else /* don't dllimport classes/methods on GCC/MinGW */ @@ -36,5 +40,12 @@ #define LIBXMLPP_API #endif /* GLIBMM_DLL */ +#ifndef LIBXMLPP_VISIBILITY_DEFAULT + #define LIBXMLPP_VISIBILITY_DEFAULT +#endif +#ifndef LIBXMLPP_MEMBER_METHOD + #define LIBXMLPP_MEMBER_METHOD LIBXMLPP_API +#endif + #endif /* _LIBXMLPP_CONFIG_H */