aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-08-07 21:49:54 +0200
committerJay Berkenbilt <ejb@ql.org>2022-08-07 22:20:49 +0200
commitcef6425bcac678157f58e9eafabb7e63c5831d18 (patch)
tree3889207c93e092679f9b8d01084c5cc1f9d7794f /include
parentda71dc6f37c69bdf708f1f9876e63ff348ae2296 (diff)
downloadqpdf-cef6425bcac678157f58e9eafabb7e63c5831d18.tar.zst
Disable QTC inside the library by default (fixes #714)
This results in measurable performance improvements to packaged binary libqpdf distributions. QTC remains available for library users and is still selectively enabled in CI.
Diffstat (limited to 'include')
-rw-r--r--include/qpdf/QTC.hh16
1 files changed, 15 insertions, 1 deletions
diff --git a/include/qpdf/QTC.hh b/include/qpdf/QTC.hh
index 1fa55901..70115981 100644
--- a/include/qpdf/QTC.hh
+++ b/include/qpdf/QTC.hh
@@ -24,10 +24,24 @@
#include <qpdf/DLL.h>
+// Defining QPDF_DISABLE_QTC will effectively compile out any QTC::TC
+// calls in any code that includes this file, but QTC will still be
+// built into the library. That way, it is possible to build and
+// package qpdf with QPDF_DISABLE_QTC while still making QTC::TC
+// available to end users.
+
namespace QTC
{
QPDF_DLL
- void TC(char const* const scope, char const* const ccase, int n = 0);
+ void TC_real(char const* const scope, char const* const ccase, int n = 0);
+
+ inline void
+ TC(char const* const scope, char const* const ccase, int n = 0)
+ {
+#ifndef QPDF_DISABLE_QTC
+ TC_real(scope, ccase, n);
+#endif // QPDF_DISABLE_QTC
+ }
}; // namespace QTC
#endif // QTC_HH