Source

nsis64 / Source / Platform.h

Diff from to

File Source/Platform.h

 #endif
 
 #ifndef __BIG_ENDIAN__
+# define FIX_ENDIAN_INT64_INPLACE(x) ((void)(x))
+# define FIX_ENDIAN_INT64(x) (x)
 # define FIX_ENDIAN_INT32_INPLACE(x) ((void)(x))
 # define FIX_ENDIAN_INT32(x) (x)
 # define FIX_ENDIAN_INT16_INPLACE(x) ((void)(x))
 # define FIX_ENDIAN_INT16(x) (x)
 #else
+# define FIX_ENDIAN_INT64_INPLACE(x) ((x) = SWAP_ENDIAN_INT64(x))
+# define FIX_ENDIAN_INT64(x) SWAP_ENDIAN_INT64(x)
 # define FIX_ENDIAN_INT32_INPLACE(x) ((x) = SWAP_ENDIAN_INT32(x))
 # define FIX_ENDIAN_INT32(x) SWAP_ENDIAN_INT32(x)
 # define FIX_ENDIAN_INT16_INPLACE(x) ((x) = SWAP_ENDIAN_INT16(x))
 # define FIX_ENDIAN_INT16(x) SWAP_ENDIAN_INT16(x)
 #endif
+#define SWAP_ENDIAN_INT64(x) ( \
+  (((x)&0xFF00000000000000) >> 56) | \
+  (((x)&0x00FF000000000000) >> 40) | \
+  (((x)&0x0000FF0000000000) >> 24) | \
+  (((x)&0x000000FF00000000) >>  8) | \
+  (((x)&0x00000000FF000000) <<  8) | \
+  (((x)&0x0000000000FF0000) << 24) | \
+  (((x)&0x000000000000FF00) << 40) | \
+  (((x)&0x00000000000000FF) << 56) )
 #define SWAP_ENDIAN_INT32(x) ( \
   (((x)&0xFF000000) >> 24) | \
   (((x)&0x00FF0000) >>  8) | \
   (((x)&0xFF00) >> 8) | \
   (((x)&0x00FF) << 8) )
 
+#ifdef SYSTEM_X64
+# define FIX_ENDIAN_INT_PTR FIX_ENDIAN_INT64
+# define FIX_ENDIAN_INT_PTR_INPLACE FIX_ENDIAN_INT64_INPLACE
+# define SWAP_ENDIAN_INT_PTR SWAP_ENDIAN_INT64
+#else
+# define FIX_ENDIAN_INT_PTR FIX_ENDIAN_INT32
+# define FIX_ENDIAN_INT_PTR_INPLACE FIX_ENDIAN_INT32_INPLACE
+# define SWAP_ENDIAN_INT_PTR SWAP_ENDIAN_INT32
+#endif
+
 // script path separator
 
 #  define PATH_SEPARATOR_STR _T("\\")