diff --git a/include/qpdf/DLL.h b/include/qpdf/DLL.h index ccd05fc..1e5d8a1 100644 --- a/include/qpdf/DLL.h +++ b/include/qpdf/DLL.h @@ -25,8 +25,13 @@ #if defined(_WIN32) && defined(DLL_EXPORT) # define QPDF_DLL __declspec(dllexport) +# define QPDF_DLL_EXCEPTION +#elif __GNUC__ >= 4 +# define QPDF_DLL __attribute__ ((visibility ("default"))) +# define QPDF_DLL_EXCEPTION __attribute__ ((visibility ("default"))) #else # define QPDF_DLL +# define QPDF_DLL_EXCEPTION #endif #endif /* QPDF_DLL_HH */ diff --git a/include/qpdf/QPDFExc.hh b/include/qpdf/QPDFExc.hh index fe0aa1d..c538eb4 100644 --- a/include/qpdf/QPDFExc.hh +++ b/include/qpdf/QPDFExc.hh @@ -29,7 +29,7 @@ #include #include -class QPDFExc: public std::runtime_error +class QPDF_DLL_EXCEPTION QPDFExc: public std::runtime_error { public: QPDF_DLL diff --git a/include/qpdf/QPDFSystemError.hh b/include/qpdf/QPDFSystemError.hh index c4e4871..cef8ea0 100644 --- a/include/qpdf/QPDFSystemError.hh +++ b/include/qpdf/QPDFSystemError.hh @@ -29,7 +29,7 @@ #include #include -class QPDFSystemError: public std::runtime_error +class QPDF_DLL_EXCEPTION QPDFSystemError: public std::runtime_error { public: QPDF_DLL