summaryrefslogtreecommitdiff
path: root/source/fitz/context.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2013-08-29 15:27:45 +0200
committerTor Andersson <tor.andersson@artifex.com>2013-09-03 11:25:47 +0200
commit5d37b6096afe4cb76571b32a95f4aca5f98572ec (patch)
treed83683a23c4bb2e218cd03ef10a7dd1786727a20 /source/fitz/context.c
parentf66ab69b6a8c7112779e61c6ed7d253d8798f9f1 (diff)
downloadmupdf-5d37b6096afe4cb76571b32a95f4aca5f98572ec.tar.xz
Add FZ_VERSION define. Check header and library version compatibility.
Diffstat (limited to 'source/fitz/context.c')
-rw-r--r--source/fitz/context.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/fitz/context.c b/source/fitz/context.c
index c65377a8..72ea2d6a 100644
--- a/source/fitz/context.c
+++ b/source/fitz/context.c
@@ -121,10 +121,16 @@ cleanup:
}
fz_context *
-fz_new_context(fz_alloc_context *alloc, fz_locks_context *locks, unsigned int max_store)
+fz_new_context_imp(fz_alloc_context *alloc, fz_locks_context *locks, unsigned int max_store, const char *version)
{
fz_context *ctx;
+ if (strcmp(version, FZ_VERSION))
+ {
+ fprintf(stderr, "cannot create context: incompatible header (%s) and library (%s) versions", version, FZ_VERSION);
+ return NULL;
+ }
+
if (!alloc)
alloc = &fz_alloc_default;