git: 7f9a658424ac - main - graphics/devil: Fix build with jasper 3.0.2

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Sat, 16 Apr 2022 04:25:13 UTC
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7f9a658424acdd1918db1bff6e4cb236c7ac33c5

commit 7f9a658424acdd1918db1bff6e4cb236c7ac33c5
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2022-04-16 04:14:59 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2022-04-16 04:19:51 +0000

    graphics/devil: Fix build with jasper 3.0.2
    
    Approved by:    portmgr (blanket)
---
 graphics/devil/files/patch-DevIL_src-IL_src_il__jp2.cpp | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/graphics/devil/files/patch-DevIL_src-IL_src_il__jp2.cpp b/graphics/devil/files/patch-DevIL_src-IL_src_il__jp2.cpp
index 664d07fdff1a..2a61a2897c30 100644
--- a/graphics/devil/files/patch-DevIL_src-IL_src_il__jp2.cpp
+++ b/graphics/devil/files/patch-DevIL_src-IL_src_il__jp2.cpp
@@ -1,18 +1,27 @@
 --- DevIL/src-IL/src/il_jp2.cpp.orig	2017-01-01 23:37:37 UTC
 +++ DevIL/src-IL/src/il_jp2.cpp
-@@ -314,13 +314,13 @@ ILboolean iLoadJp2Internal(jas_stream_t	*Stream, ILima
- 
+@@ -313,14 +313,21 @@ ILboolean iLoadJp2Internal(jas_stream_t	*Stream, ILima
+ }
  
  
+-
 -static int iJp2_file_read(jas_stream_obj_t *obj, char *buf, int cnt)
-+static int iJp2_file_read(jas_stream_obj_t *obj, char *buf, unsigned int cnt)
++#if JAS_VERSION_MAJOR >= 3
++static ssize_t iJp2_file_read(jas_stream_obj_t *obj, char *buf, size_t cnt)
++#else
++static int iJp2_file_read(jas_stream_obj_t *obj, char *buf, unsigned long cnt)
++#endif
  {
  	obj;
  	return iread(buf, 1, cnt);
  }
  
 -static int iJp2_file_write(jas_stream_obj_t *obj, char *buf, int cnt)
-+static int iJp2_file_write(jas_stream_obj_t *obj, const char *buf, unsigned int cnt)
++#if JAS_VERSION_MAJOR >= 3
++static ssize_t iJp2_file_write(jas_stream_obj_t *obj, const char *buf, size_t cnt)
++#else
++static int iJp2_file_write(jas_stream_obj_t *obj, const char *buf, unsigned long cnt)
++#endif
  {
  	obj;
  	return iwrite(buf, 1, cnt);