jp2.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. diff --git a/DevIL/src-IL/src/il_jp2.cpp b/DevIL/src-IL/src/il_jp2.cpp
  2. --- a/DevIL/src-IL/src/il_jp2.cpp
  3. +++ b/DevIL/src-IL/src/il_jp2.cpp
  4. @@ -313,20 +313,31 @@ ILboolean iLoadJp2Internal(jas_stream_t *Stream, ILimage *Image)
  5. }
  6. -
  7. -static int iJp2_file_read(jas_stream_obj_t *obj, char *buf, int cnt)
  8. +#ifdef __APPLE__
  9. +static int iJp2_file_read(void *obj, char *buf, unsigned int cnt)
  10. +#else
  11. +static int iJp2_file_read(jas_stream_obj_t *obj, char *buf, unsigned int cnt)
  12. +#endif
  13. {
  14. obj;
  15. - return iread(buf, 1, cnt);
  16. + return iread((void*)buf, 1, cnt);
  17. }
  18. -static int iJp2_file_write(jas_stream_obj_t *obj, char *buf, int cnt)
  19. +#ifdef __APPLE__
  20. +static int iJp2_file_write(void *obj, const char *buf, unsigned int cnt)
  21. +#else
  22. +static int iJp2_file_write(jas_stream_obj_t *obj, const char *buf, unsigned int cnt)
  23. +#endif
  24. {
  25. obj;
  26. return iwrite(buf, 1, cnt);
  27. }
  28. +#ifdef __APPLE__
  29. static long iJp2_file_seek(jas_stream_obj_t *obj, long offset, int origin)
  30. +#else
  31. +static long iJp2_file_seek(void *obj, long offset, int origin)
  32. +#endif
  33. {
  34. obj;
  35. @@ -343,7 +354,11 @@ static long iJp2_file_seek(jas_stream_obj_t *obj, long offset, int origin)
  36. return 0; // Failed
  37. }
  38. +#ifdef __APPLE__
  39. +static int iJp2_file_close(void *obj)
  40. +#else
  41. static int iJp2_file_close(jas_stream_obj_t *obj)
  42. +#endif
  43. {
  44. obj;
  45. return 0; // We choose when we want to close the file.