summaryrefslogtreecommitdiffstats
path: root/thirdparty/zstd/common/compiler.h
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-11-10 10:18:53 +0100
committerGitHub <noreply@github.com>2019-11-10 10:18:53 +0100
commit157246ae86f14abadadfb831c8c8f14a5d033a97 (patch)
treea12563db6d658ebae18d9c97833eb9e3c2415fb6 /thirdparty/zstd/common/compiler.h
parent2143f46df26bde529db350f4b5965a6508385c2f (diff)
parent55afd6e784d8dea6779f471d35a77e4d56bfaaca (diff)
downloadredot-engine-157246ae86f14abadadfb831c8c8f14a5d033a97.tar.gz
Merge pull request #33507 from SneakyFish5/update-zstd
Update zstd to 1.4.4
Diffstat (limited to 'thirdparty/zstd/common/compiler.h')
-rw-r--r--thirdparty/zstd/common/compiler.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/thirdparty/zstd/common/compiler.h b/thirdparty/zstd/common/compiler.h
index 6686b837d6..1877a0c1d9 100644
--- a/thirdparty/zstd/common/compiler.h
+++ b/thirdparty/zstd/common/compiler.h
@@ -61,6 +61,13 @@
# define HINT_INLINE static INLINE_KEYWORD FORCE_INLINE_ATTR
#endif
+/* UNUSED_ATTR tells the compiler it is okay if the function is unused. */
+#if defined(__GNUC__)
+# define UNUSED_ATTR __attribute__((unused))
+#else
+# define UNUSED_ATTR
+#endif
+
/* force no inlining */
#ifdef _MSC_VER
# define FORCE_NOINLINE static __declspec(noinline)
@@ -127,9 +134,14 @@
} \
}
-/* vectorization */
+/* vectorization
+ * older GCC (pre gcc-4.3 picked as the cutoff) uses a different syntax */
#if !defined(__clang__) && defined(__GNUC__)
-# define DONT_VECTORIZE __attribute__((optimize("no-tree-vectorize")))
+# if (__GNUC__ == 4 && __GNUC_MINOR__ > 3) || (__GNUC__ >= 5)
+# define DONT_VECTORIZE __attribute__((optimize("no-tree-vectorize")))
+# else
+# define DONT_VECTORIZE _Pragma("GCC optimize(\"no-tree-vectorize\")")
+# endif
#else
# define DONT_VECTORIZE
#endif