Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
7638 views
1
From: =?utf-8?q?=22Kan-Ru_Chen_=28=E9=99=B3=E4=BE=83=E5=A6=82=29=22?=
2
<[email protected]>
3
Date: Sat, 20 Sep 2014 12:33:08 +0800
4
Subject: Fix build with libopenjp2
5
6
---
7
Makerules | 4 ++--
8
source/fitz/load-jpx.c | 10 +---------
9
2 files changed, 3 insertions(+), 11 deletions(-)
10
11
diff --git a/Makerules b/Makerules
12
index 75573da..62953d7 100644
13
--- a/Makerules
14
+++ b/Makerules
15
@@ -75,8 +75,8 @@ SYS_X11_LIBS = $(shell pkg-config --libs x11 xext)
16
17
SYS_FREETYPE_CFLAGS = $(shell pkg-config --cflags freetype2)
18
SYS_FREETYPE_LIBS = $(shell pkg-config --libs freetype2)
19
-SYS_OPENJPEG_CFLAGS = $(shell pkg-config --cflags libopenjp2)
20
-SYS_OPENJPEG_LIBS = $(shell pkg-config --libs libopenjp2)
21
+SYS_OPENJPEG_CFLAGS = -I/usr/include/openjpeg-2.1
22
+SYS_OPENJPEG_LIBS = -lopenjp2
23
SYS_JBIG2DEC_LIBS = -ljbig2dec
24
SYS_JPEG_LIBS = -ljpeg
25
SYS_ZLIB_LIBS = -lz
26
diff --git a/source/fitz/load-jpx.c b/source/fitz/load-jpx.c
27
index 7cd3647..fbbe33b 100644
28
--- a/source/fitz/load-jpx.c
29
+++ b/source/fitz/load-jpx.c
30
@@ -1,13 +1,5 @@
31
#include "mupdf/fitz.h"
32
33
-/* Without the definition of OPJ_STATIC, compilation fails on windows
34
- * due to the use of __stdcall. We believe it is required on some
35
- * linux toolchains too. */
36
-#define OPJ_STATIC
37
-#ifndef _MSC_VER
38
-#define OPJ_HAVE_STDINT_H
39
-#endif
40
-
41
#include <openjpeg.h>
42
43
static void fz_opj_error_callback(const char *msg, void *client_data)
44
@@ -117,7 +109,7 @@ fz_load_jpx(fz_context *ctx, unsigned char *data, int size, fz_colorspace *defcs
45
opj_stream_set_read_function(stream, fz_opj_stream_read);
46
opj_stream_set_skip_function(stream, fz_opj_stream_skip);
47
opj_stream_set_seek_function(stream, fz_opj_stream_seek);
48
- opj_stream_set_user_data(stream, &sb);
49
+ opj_stream_set_user_data(stream, &sb, NULL);
50
/* Set the length to avoid an assert */
51
opj_stream_set_user_data_length(stream, size);
52
53
54