Skip to content

Commit

Permalink
ECC-1477: Compilation fails with libjasper v4.x.x
Browse files Browse the repository at this point in the history
  • Loading branch information
shahramn committed Nov 28, 2022
1 parent 8eaa163 commit 3fb11b3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/grib_jasper_encoding.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

static int ecc_jasper_initialise()
{
#if JASPER_VERSION_MAJOR == 3
#if JASPER_VERSION_MAJOR >= 3
int jaserr = 0;
jas_conf_clear();
jas_conf_set_max_mem_usage(jas_get_total_mem_size());
Expand All @@ -36,7 +36,7 @@ static int ecc_jasper_initialise()

static jas_image_t* ecc_jasper_decode(jas_stream_t *in)
{
#if JASPER_VERSION_MAJOR == 3
#if JASPER_VERSION_MAJOR >= 3
/* Second argument (=fmt) < 0 means "If possible, try to determine the format of the input data" */
return jas_image_decode(in, -1, 0);
#else
Expand All @@ -46,7 +46,7 @@ static jas_image_t* ecc_jasper_decode(jas_stream_t *in)

static int ecc_jasper_encode(jas_image_t *image, jas_stream_t *jpcstream, char *optstr)
{
#if JASPER_VERSION_MAJOR == 3
#if JASPER_VERSION_MAJOR >= 3
const int fmt = jas_image_strtofmt("jpc");
return jas_image_encode(image, jpcstream, fmt, optstr);
#else
Expand All @@ -56,7 +56,7 @@ static int ecc_jasper_encode(jas_image_t *image, jas_stream_t *jpcstream, char *

static void ecc_jasper_cleanup()
{
#if JASPER_VERSION_MAJOR == 3
#if JASPER_VERSION_MAJOR >= 3
jas_cleanup_thread();
jas_cleanup_library();
#endif
Expand Down

0 comments on commit 3fb11b3

Please sign in to comment.