2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-05-28 16:00:53 +00:00

Fix C++ exception handling when -fvisibility=hidden (#302)

Fix C++ exception handling when -fvisibility=hidden

Ensure that QPDFExc and QPDFSystemError are marked visible, so that their typeinfo will not be
suppressed when -fvisibility=hidden.

Details:
    https://gcc.gnu.org/wiki/Visibility
This commit is contained in:
jbarlow83 2019-03-11 15:28:29 -07:00 committed by Jay Berkenbilt
parent af42fe9daf
commit 2efec4ce7b
3 changed files with 7 additions and 2 deletions

View File

@ -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 */

View File

@ -29,7 +29,7 @@
#include <string>
#include <stdexcept>
class QPDFExc: public std::runtime_error
class QPDF_DLL_EXCEPTION QPDFExc: public std::runtime_error
{
public:
QPDF_DLL

View File

@ -29,7 +29,7 @@
#include <string>
#include <stdexcept>
class QPDFSystemError: public std::runtime_error
class QPDF_DLL_EXCEPTION QPDFSystemError: public std::runtime_error
{
public:
QPDF_DLL