Commit 2efec4ce7bb31524d55596051adfe9fc3d6dacb1
Committed by
Jay Berkenbilt
1 parent
af42fe9d
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
Showing
3 changed files
with
7 additions
and
2 deletions
include/qpdf/DLL.h
| ... | ... | @@ -25,8 +25,13 @@ |
| 25 | 25 | |
| 26 | 26 | #if defined(_WIN32) && defined(DLL_EXPORT) |
| 27 | 27 | # define QPDF_DLL __declspec(dllexport) |
| 28 | +# define QPDF_DLL_EXCEPTION | |
| 29 | +#elif __GNUC__ >= 4 | |
| 30 | +# define QPDF_DLL __attribute__ ((visibility ("default"))) | |
| 31 | +# define QPDF_DLL_EXCEPTION __attribute__ ((visibility ("default"))) | |
| 28 | 32 | #else |
| 29 | 33 | # define QPDF_DLL |
| 34 | +# define QPDF_DLL_EXCEPTION | |
| 30 | 35 | #endif |
| 31 | 36 | |
| 32 | 37 | #endif /* QPDF_DLL_HH */ | ... | ... |
include/qpdf/QPDFExc.hh
include/qpdf/QPDFSystemError.hh