Files
macports-ports/graphics/freeimage/files/patch-c99-fixes.diff

74 lines
2.2 KiB
Diff

--- Source/LibJXR/image/sys/strcodec.c.orig 2015-02-21 04:36:26.000000000 +0000
+++ Source/LibJXR/image/sys/strcodec.c 2020-12-09 12:11:53.000000000 +0000
@@ -664,24 +664,6 @@
//================================================================
// Memory access functions
//================================================================
-#if (defined(WIN32) && !defined(UNDER_CE) && (!defined(__MINGW32__) || defined(__MINGW64_TOOLCHAIN__))) || (defined(UNDER_CE) && defined(_ARM_))
-// WinCE ARM and Desktop x86
-#else
-// other platform
-#ifdef _BIG__ENDIAN_
-#define _byteswap_ulong(x) (x)
-#else // _BIG__ENDIAN_
-U32 _byteswap_ulong(U32 bits)
-{
- U32 r = (bits & 0xffu) << 24;
- r |= (bits << 8) & 0xff0000u;
- r |= ((bits >> 8) & 0xff00u);
- r |= ((bits >> 24) & 0xffu);
-
- return r;
-}
-#endif // _BIG__ENDIAN_
-#endif
U32 load4BE(void* pv)
{
--- Source/LibJXR/image/sys/strcodec.h.orig 2015-02-21 04:35:46.000000000 +0000
+++ Source/LibJXR/image/sys/strcodec.h 2020-12-09 12:28:41.000000000 +0000
@@ -28,6 +28,7 @@
#pragma once
#include <stddef.h>
+#include <stdlib.h>
#if defined(__MINGW32__)
#include <stdint.h>
#endif
@@ -117,6 +118,25 @@
#define TraceResult(a)
+#if (defined(WIN32) && !defined(UNDER_CE) && (!defined(__MINGW32__) || defined(__MINGW64_TOOLCHAIN__))) || (defined(UNDER_CE) && defined(_ARM_))
+// WinCE ARM and Desktop x86
+#else
+// other platform
+#ifdef _BIG__ENDIAN_
+#define _byteswap_ulong(x) (x)
+#else // _BIG__ENDIAN_
+static inline U32 _byteswap_ulong(U32 bits)
+{
+ U32 r = (bits & 0xffu) << 24;
+ r |= (bits << 8) & 0xff0000u;
+ r |= ((bits >> 8) & 0xff00u);
+ r |= ((bits >> 24) & 0xffu);
+
+ return r;
+}
+#endif // _BIG__ENDIAN_
+#endif
+
//================================================================
typedef enum tagPacketType
{
--- Source/LibJXR/jxrgluelib/JXRGlueJxr.c.orig 2013-12-06 23:04:54.000000000 +0000
+++ Source/LibJXR/jxrgluelib/JXRGlueJxr.c 2020-12-09 12:14:48.000000000 +0000
@@ -27,6 +27,7 @@
//
//*@@@---@@@@******************************************************************
#include <limits.h>
+#include <wchar.h>
#include <JXRGlue.h>