VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Crypto/config.h
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2017-01-12 18:12:10 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2017-01-12 18:13:24 +0100
commitc0f46187dec76c4ff980a3267d716e7f05c92f33 (patch)
treea172fc09f6e07eac163507004a3b57684631240f /src/Crypto/config.h
parent386f7bc9b043a2140b61210289ee27b03ca3fda8 (diff)
downloadVeraCrypt-c0f46187dec76c4ff980a3267d716e7f05c92f33.tar.gz
VeraCrypt-c0f46187dec76c4ff980a3267d716e7f05c92f33.zip
Fix build error in Crypto/Whirpool.c when using LLVM Clang compiler by disabling inline assembly in this case (caused by http://llvm.org/bugs/show_bug.cgi?id=24232)
Diffstat (limited to 'src/Crypto/config.h')
-rw-r--r--src/Crypto/config.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/Crypto/config.h b/src/Crypto/config.h
index 792ac678..03b1ecb4 100644
--- a/src/Crypto/config.h
+++ b/src/Crypto/config.h
@@ -9,6 +9,12 @@
#define VC_INLINE static inline
#endif
+// Clang pretends to be VC++, too.
+// See http://github.com/weidai11/cryptopp/issues/147
+#if defined(_MSC_VER) && defined(__clang__)
+# error: "Unsupported configuration"
+#endif
+
#ifdef __GNUC__
#define CRYPTOPP_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
#endif
@@ -16,15 +22,17 @@
// Apple and LLVM's Clang. Apple Clang version 7.0 roughly equals LLVM Clang version 3.7
#if defined(__clang__ ) && !defined(__apple_build_version__)
- #define CRYPTOPP_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
+ #define CRYPTOPP_LLVM_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
+ #define CRYPTOPP_CLANG_INTEGRATED_ASSEMBLER 1
#elif defined(__clang__ ) && defined(__apple_build_version__)
- #define CRYPTOPP_APPLE_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
+ #define CRYPTOPP_APPLE_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
+ #define CRYPTOPP_CLANG_INTEGRATED_ASSEMBLER 1
#endif
// Clang due to "Inline assembly operands don't work with .intel_syntax", http://llvm.org/bugs/show_bug.cgi?id=24232
// TODO: supply the upper version when LLVM fixes it. We set it to 20.0 for compilation purposes.
-#if (defined(CRYPTOPP_CLANG_VERSION) && CRYPTOPP_CLANG_VERSION <= 200000) || (defined(CRYPTOPP_APPLE_CLANG_VERSION) && CRYPTOPP_APPLE_CLANG_VERSION <= 200000)
-#define CRYPTOPP_DISABLE_INTEL_ASM 1
+#if (defined(CRYPTOPP_LLVM_CLANG_VERSION) && CRYPTOPP_LLVM_CLANG_VERSION <= 200000) || (defined(CRYPTOPP_APPLE_CLANG_VERSION) && CRYPTOPP_APPLE_CLANG_VERSION <= 200000) || defined(CRYPTOPP_CLANG_INTEGRATED_ASSEMBLER)
+ #define CRYPTOPP_DISABLE_INTEL_ASM 1
#endif
#ifndef CRYPTOPP_L1_CACHE_LINE_SIZE