summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2022-07-01 16:58:07 +0200
committerMoonchild <moonchild@palemoon.org>2022-07-01 16:58:07 +0200
commit113e84f6b222274d4992dbd6ed91800a980bfd20 (patch)
tree32f3b03c682721ffe4098c8e0a041603e3b0637b
parent1e25e4d7aa8497dda463fb1ca000f64e2393c8fa (diff)
downloaduxp-VS2017.tar.gz
Issue #1817 - Include <intrin.h> at top-level before lz4.c can includeVS2017
it in a namespace. BZ Bug 1345331
-rw-r--r--mfbt/Compression.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/mfbt/Compression.cpp b/mfbt/Compression.cpp
index 6147d0d611..f1855ba2e7 100644
--- a/mfbt/Compression.cpp
+++ b/mfbt/Compression.cpp
@@ -11,6 +11,15 @@
// corecrt_memory.h.
#include <string>
+// Because we wrap lz4.c in an anonymous namespace, all of its #includes
+// go in the anonymous namespace too. This would create conflicting
+// declarations for intrinsic functions that are internally defined
+// at top-level. Including intrin.h here prevents it from being included
+// later within the anonymous namespace.
+#ifdef _MSC_VER
+#include <intrin.h>
+#endif
+
using namespace mozilla::Compression;
namespace {