Skip to content

exceptions/exception.h: Try fixing linking on MinGW #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions libxml++/exceptions/exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
Expand Down
11 changes: 11 additions & 0 deletions libxml++config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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 */

11 changes: 11 additions & 0 deletions libxml++config.h.meson
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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 */