[evince] unarr: Update LZMA SDK



commit ccbeb9cca23b84ddb2d4f1e1d7e745a92d219ddb
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Aug 30 21:54:04 2017 +0200

    unarr: Update LZMA SDK
    
    Using lzma1701.7z from:
    https://sourceforge.net/projects/sevenzip/files/LZMA%20SDK/
    
    https://bugzilla.gnome.org/show_bug.cgi?id=787035

 cut-n-paste/unarr/lzmasdk/7zTypes.h |   12 +++++++++++-
 cut-n-paste/unarr/lzmasdk/CpuArch.h |   22 ++++++++++++++++++----
 cut-n-paste/unarr/lzmasdk/Precomp.h |    5 -----
 3 files changed, 29 insertions(+), 10 deletions(-)
---
diff --git a/cut-n-paste/unarr/lzmasdk/7zTypes.h b/cut-n-paste/unarr/lzmasdk/7zTypes.h
index 588ec5e..29244b2 100644
--- a/cut-n-paste/unarr/lzmasdk/7zTypes.h
+++ b/cut-n-paste/unarr/lzmasdk/7zTypes.h
@@ -1,5 +1,5 @@
 /* 7zTypes.h -- Basic types
-2017-04-03 : Igor Pavlov : Public domain */
+2017-07-17 : Igor Pavlov : Public domain */
 
 #ifndef __7Z_TYPES_H
 #define __7Z_TYPES_H
@@ -42,13 +42,23 @@ EXTERN_C_BEGIN
 
 typedef int SRes;
 
+
 #ifdef _WIN32
+
 /* typedef DWORD WRes; */
 typedef unsigned WRes;
+#define MY_SRes_HRESULT_FROM_WRes(x) HRESULT_FROM_WIN32(x)
+
 #else
+
 typedef int WRes;
+#define MY__FACILITY_WIN32 7
+#define MY__FACILITY__WRes MY__FACILITY_WIN32
+#define MY_SRes_HRESULT_FROM_WRes(x) ((HRESULT)(x) <= 0 ? ((HRESULT)(x)) : ((HRESULT) (((x) & 0x0000FFFF) | 
(MY__FACILITY__WRes << 16) | 0x80000000)))
+
 #endif
 
+
 #ifndef RINOK
 #define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; }
 #endif
diff --git a/cut-n-paste/unarr/lzmasdk/CpuArch.h b/cut-n-paste/unarr/lzmasdk/CpuArch.h
index 7155422..afb6b67 100644
--- a/cut-n-paste/unarr/lzmasdk/CpuArch.h
+++ b/cut-n-paste/unarr/lzmasdk/CpuArch.h
@@ -1,5 +1,5 @@
 /* CpuArch.h -- CPU specific code
-2017-04-03 : Igor Pavlov : Public domain */
+2017-06-30 : Igor Pavlov : Public domain */
 
 #ifndef __CPU_ARCH_H
 #define __CPU_ARCH_H
@@ -190,8 +190,7 @@ MY_CPU_LE_UNALIGN means that CPU is LITTLE ENDIAN and CPU supports unaligned mem
 #ifdef MY_CPU_LE
   #if defined(MY_CPU_X86_OR_AMD64) \
       || defined(MY_CPU_ARM64) \
-      || defined(__ARM_FEATURE_UNALIGNED) \
-      || defined(__AARCH64EL__)
+      || defined(__ARM_FEATURE_UNALIGNED)
     #define MY_CPU_LE_UNALIGN
   #endif
 #endif
@@ -237,6 +236,11 @@ MY_CPU_LE_UNALIGN means that CPU is LITTLE ENDIAN and CPU supports unaligned mem
 
 #endif
 
+#ifdef __has_builtin
+  #define MY__has_builtin(x) __has_builtin(x)
+#else
+  #define MY__has_builtin(x) 0
+#endif
 
 #if defined(MY_CPU_LE_UNALIGN) && /* defined(_WIN64) && */ (_MSC_VER >= 1300)
 
@@ -244,15 +248,21 @@ MY_CPU_LE_UNALIGN means that CPU is LITTLE ENDIAN and CPU supports unaligned mem
 
 #include <stdlib.h>
 
+#pragma intrinsic(_byteswap_ushort)
 #pragma intrinsic(_byteswap_ulong)
 #pragma intrinsic(_byteswap_uint64)
+
+/* #define GetBe16(p) _byteswap_ushort(*(const UInt16 *)(const Byte *)(p)) */
 #define GetBe32(p) _byteswap_ulong(*(const UInt32 *)(const Byte *)(p))
 #define GetBe64(p) _byteswap_uint64(*(const UInt64 *)(const Byte *)(p))
 
 #define SetBe32(p, v) (*(UInt32 *)(void *)(p)) = _byteswap_ulong(v)
 
-#elif defined(MY_CPU_LE_UNALIGN) && defined (__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ 
= 3))
+#elif defined(MY_CPU_LE_UNALIGN) && ( \
+       (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) \
+    || (defined(__clang__) && MY__has_builtin(__builtin_bswap16)) )
 
+/* #define GetBe16(p) __builtin_bswap16(*(const UInt16 *)(const Byte *)(p)) */
 #define GetBe32(p) __builtin_bswap32(*(const UInt32 *)(const Byte *)(p))
 #define GetBe64(p) __builtin_bswap64(*(const UInt64 *)(const Byte *)(p))
 
@@ -277,10 +287,14 @@ MY_CPU_LE_UNALIGN means that CPU is LITTLE ENDIAN and CPU supports unaligned mem
 #endif
 
 
+#ifndef GetBe16
+
 #define GetBe16(p) ( (UInt16) ( \
     ((UInt16)((const Byte *)(p))[0] << 8) | \
              ((const Byte *)(p))[1] ))
 
+#endif
+
 
 
 #ifdef MY_CPU_X86_OR_AMD64
diff --git a/cut-n-paste/unarr/lzmasdk/Precomp.h b/cut-n-paste/unarr/lzmasdk/Precomp.h
index 895bc35..25d8aed 100644
--- a/cut-n-paste/unarr/lzmasdk/Precomp.h
+++ b/cut-n-paste/unarr/lzmasdk/Precomp.h
@@ -5,11 +5,6 @@
 #define __7Z_PRECOMP_H
 
 /* #include "Compiler.h" */
-#ifdef _MSC_VER
-#pragma warning(disable : 4456) // declaration of * hides previous local declaration
-#pragma warning(disable : 4457) // declaration of * hides function parameter
-#pragma warning(disable : 4996) // This function or variable may be unsafe
-#endif
 /* #include "7zTypes.h" */
 
 #endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]