diff options
author | Denton Woods <denton.woods@unt.edu> | 2021-08-29 07:42:14 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-29 07:42:14 -0500 |
commit | 6f3d5e9bc5d173f56060fc8e14bed35c8edcfdcc (patch) | |
tree | 7947f0c8c4144d2ce21a09876d072f1701b2799d | |
parent | e34284a7e07763769f671a74b4fec718174ad862 (diff) | |
parent | 42a62648e727e9a0217280474546de3ac69cbff1 (diff) | |
download | devil-6f3d5e9bc5d173f56060fc8e14bed35c8edcfdcc.tar.gz |
Compile against newer versions of Jasper
-rw-r--r-- | DevIL/src-IL/src/il_jp2.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/DevIL/src-IL/src/il_jp2.cpp b/DevIL/src-IL/src/il_jp2.cpp index 730afee8..89075a52 100644 --- a/DevIL/src-IL/src/il_jp2.cpp +++ b/DevIL/src-IL/src/il_jp2.cpp @@ -314,13 +314,32 @@ ILboolean iLoadJp2Internal(jas_stream_t *Stream, ILimage *Image) +// Hack to compile against different versions of Jasper which expect +// slightly different function types for their callbacks. The defined() +// checks are just looking for sybols that happen to have arrived around +// the same time as the API change, so no reason they won't break in the +// future :-( Hopefully by the time it does nobody will care about pre-2.0.20 +// versions of jasper +// +// see: https://github.com/OSGeo/gdal/commit/9ef8e16e27c5fc4c491debe50bf2b7f3e94ed334 +// https://github.com/DentonW/DevIL/issues/90 +#if defined(PRIjas_seqent) +static int iJp2_file_read(jas_stream_obj_t *obj, char *buf, unsigned cnt) +#else static int iJp2_file_read(jas_stream_obj_t *obj, char *buf, int cnt) +#endif { obj; return iread(buf, 1, cnt); } +#if defined(JAS_INCLUDE_JP2_CODEC) +static int iJp2_file_write(jas_stream_obj_t *obj, const char *buf, unsigned cnt) +#elif defined(PRIjas_seqent) +static int iJp2_file_write(jas_stream_obj_t *obj, char *buf, unsigned cnt) +#else static int iJp2_file_write(jas_stream_obj_t *obj, char *buf, int cnt) +#endif { obj; return iwrite(buf, 1, cnt); |