From 258f03a0a55c1aa802e1be47e463d8abc5096196 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Wed, 8 Nov 2017 19:45:14 +0000 Subject: Bug 698353: Avoid having our API depend on DEBUG/NDEBUG. Currently, our API uses static inlines for fz_lock and fz_unlock, the definitions for which depend on whether we build NDEBUG or not. This isn't ideal as it causes problems when people link a release binary with a debug lib (or vice versa). We really want to continue to use static inlines for the locking functions as used from MuPDF, as we hit them hard in the keep/drop functions. We therefore remove fz_lock/fz_unlock from the public API entirely. Accordingly, we move the fz_lock/fz_unlock static inlines into fitz-imp.h (an internal header), together with the fz_keep_.../fz_drop_... functions. We then have public fz_lock/fz_unlock functions for any external callers to use that are free of compilications. At the same time, to avoid another indirection, we change from holding the locking functions as a pointer to a struct to a struct itself. --- source/pdf/pdf-font.c | 1 + source/pdf/pdf-graft.c | 1 + source/pdf/pdf-object.c | 1 + source/pdf/pdf-pkcs7.c | 1 + 4 files changed, 4 insertions(+) (limited to 'source/pdf') diff --git a/source/pdf/pdf-font.c b/source/pdf/pdf-font.c index 96de61ef..f3a48f2d 100644 --- a/source/pdf/pdf-font.c +++ b/source/pdf/pdf-font.c @@ -2,6 +2,7 @@ #include "mupdf/pdf.h" #include "../fitz/font-imp.h" +#include "../fitz/fitz-imp.h" #include diff --git a/source/pdf/pdf-graft.c b/source/pdf/pdf-graft.c index 50454e40..50be9790 100644 --- a/source/pdf/pdf-graft.c +++ b/source/pdf/pdf-graft.c @@ -1,5 +1,6 @@ #include "mupdf/fitz.h" #include "mupdf/pdf.h" +#include "../fitz/fitz-imp.h" #include diff --git a/source/pdf/pdf-object.c b/source/pdf/pdf-object.c index 7788869e..816d7e3d 100644 --- a/source/pdf/pdf-object.c +++ b/source/pdf/pdf-object.c @@ -1,5 +1,6 @@ #include "mupdf/fitz.h" #include "mupdf/pdf.h" +#include "../fitz/fitz-imp.h" #include "pdf-name-table.h" diff --git a/source/pdf/pdf-pkcs7.c b/source/pdf/pdf-pkcs7.c index cab54742..403c3f7d 100644 --- a/source/pdf/pdf-pkcs7.c +++ b/source/pdf/pdf-pkcs7.c @@ -1,5 +1,6 @@ #include "mupdf/fitz.h" #include "mupdf/pdf.h" +#include "../fitz/fitz-imp.h" #include -- cgit v1.2.3