Skip to content

Commit

Permalink
jpeg_memsrcdest: extend feature check
Browse files Browse the repository at this point in the history
libjpeg.h in OpenEmbedded master (from libjpeg-turbo 1.5.0) provides
these methods if "JPEG_LIB_VERSION >= 80 ||
defined(MEM_SRCDST_SUPPORTED)".

The support for the jpeg_mem functions was added even when not
emulating the libjpeg8 API, controlled via the MEM_SRCDST_SUPPORTED
define, so checking for the version alone is not enough anymore.

See libjpeg-turbo/libjpeg-turbo@ab70623

This fixes errors about conflicting declarations (signed vs. unsigned
char).

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
  • Loading branch information
pohly committed Jun 15, 2016
1 parent b671f34 commit 0df14db
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions camlibs/ax203/jpeg_memsrcdest.c
Expand Up @@ -25,8 +25,8 @@
#include "jpeg_memsrcdest.h"

/* libjpeg8 and later come with their own (API compatible) memory source
and dest */
#if JPEG_LIB_VERSION < 80
and dest, and older versions may have it backported */
#if JPEG_LIB_VERSION < 80 && !defined(MEM_SRCDST_SUPPORTED)

/* Expanded data source object for memory input */

Expand Down
4 changes: 4 additions & 0 deletions camlibs/ax203/jpeg_memsrcdest.h
@@ -1,9 +1,13 @@
#include <jpeglib.h>

#if JPEG_LIB_VERSION < 80 && !defined(MEM_SRCDST_SUPPORTED)

void
jpeg_mem_src (j_decompress_ptr cinfo, unsigned char * buffer,
unsigned long bufsize);

void
jpeg_mem_dest (j_compress_ptr cinfo, unsigned char ** outbuffer,
unsigned long * outsize);

#endif
4 changes: 2 additions & 2 deletions camlibs/jl2005c/jpeg_memsrcdest.c
Expand Up @@ -25,8 +25,8 @@
#include "jpeg_memsrcdest.h"

/* libjpeg8 and later come with their own (API compatible) memory source
and dest */
#if JPEG_LIB_VERSION < 80
and dest, and older versions may have it backported */
#if JPEG_LIB_VERSION < 80 && !defined(MEM_SRCDST_SUPPORTED)

/* Expanded data source object for memory input */

Expand Down
4 changes: 4 additions & 0 deletions camlibs/jl2005c/jpeg_memsrcdest.h
@@ -1,9 +1,13 @@
#include <jpeglib.h>

#if JPEG_LIB_VERSION < 80 && !defined(MEM_SRCDST_SUPPORTED)

void
jpeg_mem_src (j_decompress_ptr cinfo, unsigned char * buffer,
unsigned long bufsize);

void
jpeg_mem_dest (j_compress_ptr cinfo, unsigned char ** outbuffer,
unsigned long * outsize);

#endif

0 comments on commit 0df14db

Please sign in to comment.