aboutsummaryrefslogtreecommitdiffstats
path: root/libarchive/xxhash.c
diff options
context:
space:
mode:
Diffstat (limited to 'libarchive/xxhash.c')
-rw-r--r--libarchive/xxhash.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/libarchive/xxhash.c b/libarchive/xxhash.c
index 6f5ba52fac32..70750bae0863 100644
--- a/libarchive/xxhash.c
+++ b/libarchive/xxhash.c
@@ -141,13 +141,19 @@ typedef struct _U32_S { U32 v; } _PACKED U32_S;
# pragma pack(pop)
#endif
-#define A32(x) (((const U32_S *)(x))->v)
-
/****************************************
** Compiler-specific Functions and Macros
*****************************************/
-#define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
+#define GCC_VERSION ((__GNUC__-0) * 100 + (__GNUC_MINOR__ - 0))
+
+#if GCC_VERSION >= 409
+__attribute__((__no_sanitize_undefined__))
+#endif
+static inline U32 A32(const void * x)
+{
+ return (((const U32_S *)(x))->v);
+}
/* Note : although _rotl exists for minGW (GCC under windows), performance seems poor */
#if defined(_MSC_VER)