aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-10-06 14:05:48 +0200
committerJay Berkenbilt <ejb@ql.org>2022-10-06 14:40:08 +0200
commit5c5b4e640e2df248192ff7aa518fb0d345884a33 (patch)
tree1f2a331ee8f0aa8cba685b0192d093238a919e7e /include
parentdb6598b449f4edbb69a581ecc8bc6791e24ad3ea (diff)
downloadqpdf-5c5b4e640e2df248192ff7aa518fb0d345884a33.tar.zst
Be more conservative about QPDF_DLL_CLASS with mingw (fixes #799)
* Define it even though previous experiments have shown it to be unnecessary since it seems like it may be necessary after all * Add QPDF_DLL_CLASS to QPDFObjectHelper and QPDFDocumentHelper in case there's some future unknown reason why someone may want to have them and/or in case it helps with the weird QPDFNameTreeObjectHelper problem.
Diffstat (limited to 'include')
-rw-r--r--include/qpdf/DLL.h9
-rw-r--r--include/qpdf/QPDFDocumentHelper.hh4
-rw-r--r--include/qpdf/QPDFObjectHelper.hh4
3 files changed, 11 insertions, 6 deletions
diff --git a/include/qpdf/DLL.h b/include/qpdf/DLL.h
index 14cc5bae..257486b0 100644
--- a/include/qpdf/DLL.h
+++ b/include/qpdf/DLL.h
@@ -42,14 +42,16 @@
# define QPDF_DLL
# endif
# define QPDF_DLL_PRIVATE
-# define QPDF_DLL_CLASS
#elif defined __GNUC__
# define QPDF_DLL __attribute__((visibility("default")))
# define QPDF_DLL_PRIVATE __attribute__((visibility("hidden")))
-# define QPDF_DLL_CLASS QPDF_DLL
#else
# define QPDF_DLL
# define QPDF_DLL_PRIVATE
+#endif
+#ifdef __GNUC__
+# define QPDF_DLL_CLASS QPDF_DLL
+#else
# define QPDF_DLL_CLASS
#endif
@@ -87,6 +89,9 @@ for a more in-depth discussion.
multi-platform and building both static and shared libraries that
use the same headers, so we don't bother.
+ * If we don't export base classes with mingw, the vtables don't end
+ up in the DLL.
+
* On Linux (and other similar systems):
* Common compilers such as gcc and clang export all symbols into the
diff --git a/include/qpdf/QPDFDocumentHelper.hh b/include/qpdf/QPDFDocumentHelper.hh
index 55fe3c9c..e78788ab 100644
--- a/include/qpdf/QPDFDocumentHelper.hh
+++ b/include/qpdf/QPDFDocumentHelper.hh
@@ -36,7 +36,7 @@
// introduced to allow creation of higher level helper functions
// without polluting the public interface of QPDF.
-class QPDFDocumentHelper
+class QPDF_DLL_CLASS QPDFDocumentHelper
{
public:
QPDF_DLL
@@ -45,7 +45,7 @@ class QPDFDocumentHelper
{
}
QPDF_DLL
- virtual ~QPDFDocumentHelper() = default;
+ virtual ~QPDFDocumentHelper();
QPDF_DLL
QPDF&
getQPDF()
diff --git a/include/qpdf/QPDFObjectHelper.hh b/include/qpdf/QPDFObjectHelper.hh
index db3876ec..7f0f21ca 100644
--- a/include/qpdf/QPDFObjectHelper.hh
+++ b/include/qpdf/QPDFObjectHelper.hh
@@ -37,7 +37,7 @@
// introduced to allow creation of higher level helper functions
// without polluting the public interface of QPDFObjectHandle.
-class QPDFObjectHelper
+class QPDF_DLL_CLASS QPDFObjectHelper
{
public:
QPDF_DLL
@@ -46,7 +46,7 @@ class QPDFObjectHelper
{
}
QPDF_DLL
- virtual ~QPDFObjectHelper() = default;
+ virtual ~QPDFObjectHelper();
QPDF_DLL
QPDFObjectHandle
getObjectHandle()