libjxr.patch 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. diff --git a/Source/LibJXR/image/decode/segdec.c b/Source/LibJXR/image/decode/segdec.c
  2. --- a/Source/LibJXR/image/decode/segdec.c
  3. +++ b/Source/LibJXR/image/decode/segdec.c
  4. @@ -62,8 +62,14 @@ static U32 _FORCEINLINE _load4(void* pv)
  5. v = ((U16 *) pv)[0];
  6. v |= ((U32)((U16 *) pv)[1]) << 16;
  7. return _byteswap_ulong(v);
  8. -#else // _M_IA64
  9. +#elif defined(_MSC_VER)
  10. return _byteswap_ulong(*(U32*)pv);
  11. +#else
  12. + U32 Byte0 = *(U32*)pv & 0x000000FF;
  13. + U32 Byte1 = *(U32*)pv & 0x0000FF00;
  14. + U32 Byte2 = *(U32*)pv & 0x00FF0000;
  15. + U32 Byte3 = *(U32*)pv & 0xFF000000;
  16. + return (Byte0 << 24) | (Byte1 << 8) | (Byte2 >> 8) | (Byte3 >> 24);
  17. #endif // _M_IA64
  18. #endif // _BIG__ENDIAN_
  19. }
  20. diff --git a/Source/LibJXR/jxrgluelib/JXRGlueJxr.c b/Source/LibJXR/jxrgluelib/JXRGlueJxr.c
  21. --- a/Source/LibJXR/jxrgluelib/JXRGlueJxr.c
  22. +++ b/Source/LibJXR/jxrgluelib/JXRGlueJxr.c
  23. @@ -29,6 +29,8 @@
  24. #include <limits.h>
  25. #include <JXRGlue.h>
  26. +#include <stdio.h>
  27. +#include <wchar.h>
  28. static const char szHDPhotoFormat[] = "<dc:format>image/vnd.ms-photo</dc:format>";
  29. const U32 IFDEntryTypeSizes[] = { 0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8 };