1 From 0df14db3eda1b780a27b1c54bc8f251d15afebbc Mon Sep 17 00:00:00 2001
2 From: Patrick Ohly <patrick.ohly@intel.com>
3 Date: Wed, 15 Jun 2016 10:33:24 +0200
4 Subject: [PATCH] jpeg_memsrcdest: extend feature check
5
6 libjpeg.h in OpenEmbedded master (from libjpeg-turbo 1.5.0) provides
7 these methods if "JPEG_LIB_VERSION >= 80 ||
8 defined(MEM_SRCDST_SUPPORTED)".
9
10 The support for the jpeg_mem functions was added even when not
11 emulating the libjpeg8 API, controlled via the MEM_SRCDST_SUPPORTED
12 define, so checking for the version alone is not enough anymore.
13
14 See https://github.com/libjpeg-turbo/libjpeg-turbo/commit/ab70623eb29e09e67222be5b9e1ea320fe5aa0e9
15
16 This fixes errors about conflicting declarations (signed vs. unsigned
17 char).
18
19 Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
20 ---
21 camlibs/ax203/jpeg_memsrcdest.c | 4 ++--
22 camlibs/ax203/jpeg_memsrcdest.h | 4 ++++
23 camlibs/jl2005c/jpeg_memsrcdest.c | 4 ++--
24 camlibs/jl2005c/jpeg_memsrcdest.h | 4 ++++
25 4 files changed, 12 insertions(+), 4 deletions(-)
26
27 diff --git a/camlibs/ax203/jpeg_memsrcdest.c b/camlibs/ax203/jpeg_memsrcdest.c
28 index 0ed83b1..5614573 100644
29 --- a/camlibs/ax203/jpeg_memsrcdest.c
30 +++ b/camlibs/ax203/jpeg_memsrcdest.c
31 @@ -25,8 +25,8 @@
32 #include "jpeg_memsrcdest.h"
33
34 /* libjpeg8 and later come with their own (API compatible) memory source
35 - and dest */
36 -#if JPEG_LIB_VERSION < 80
37 + and dest, and older versions may have it backported */
38 +#if JPEG_LIB_VERSION < 80 && !defined(MEM_SRCDST_SUPPORTED)
39
40 /* Expanded data source object for memory input */
41
42 diff --git a/camlibs/ax203/jpeg_memsrcdest.h b/camlibs/ax203/jpeg_memsrcdest.h
43 index e971182..b13bf3f 100644
44 --- a/camlibs/ax203/jpeg_memsrcdest.h
45 +++ b/camlibs/ax203/jpeg_memsrcdest.h
46 @@ -1,5 +1,7 @@
47 #include <jpeglib.h>
48
49 +#if JPEG_LIB_VERSION < 80 && !defined(MEM_SRCDST_SUPPORTED)
50 +
51 void
52 jpeg_mem_src (j_decompress_ptr cinfo, unsigned char * buffer,
53 unsigned long bufsize);
54 @@ -7,3 +9,5 @@ jpeg_mem_src (j_decompress_ptr cinfo, unsigned char * buffer,
55 void
56 jpeg_mem_dest (j_compress_ptr cinfo, unsigned char ** outbuffer,
57 unsigned long * outsize);
58 +
59 +#endif
60 diff --git a/camlibs/jl2005c/jpeg_memsrcdest.c b/camlibs/jl2005c/jpeg_memsrcdest.c
61 index 321f926..b65310e 100644
62 --- a/camlibs/jl2005c/jpeg_memsrcdest.c
63 +++ b/camlibs/jl2005c/jpeg_memsrcdest.c
64 @@ -25,8 +25,8 @@
65 #include "jpeg_memsrcdest.h"
66
67 /* libjpeg8 and later come with their own (API compatible) memory source
68 - and dest */
69 -#if JPEG_LIB_VERSION < 80
70 + and dest, and older versions may have it backported */
71 +#if JPEG_LIB_VERSION < 80 && !defined(MEM_SRCDST_SUPPORTED)
72
73 /* Expanded data source object for memory input */
74
75 diff --git a/camlibs/jl2005c/jpeg_memsrcdest.h b/camlibs/jl2005c/jpeg_memsrcdest.h
76 index e971182..b13bf3f 100644
77 --- a/camlibs/jl2005c/jpeg_memsrcdest.h
78 +++ b/camlibs/jl2005c/jpeg_memsrcdest.h
79 @@ -1,5 +1,7 @@
80 #include <jpeglib.h>
81
82 +#if JPEG_LIB_VERSION < 80 && !defined(MEM_SRCDST_SUPPORTED)
83 +
84 void
85 jpeg_mem_src (j_decompress_ptr cinfo, unsigned char * buffer,
86 unsigned long bufsize);
87 @@ -7,3 +9,5 @@ jpeg_mem_src (j_decompress_ptr cinfo, unsigned char * buffer,
88 void
89 jpeg_mem_dest (j_compress_ptr cinfo, unsigned char ** outbuffer,
90 unsigned long * outsize);
91 +
92 +#endif
|