From 4fed2d9fc07f16d20c296c9d9433ad99709a8611 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Wed, 19 Feb 2020 16:31:25 +0300 Subject: [PATCH] mdbx-windows: minor workaround for MSVC "unresolved external symbol __except1 ..." Workaround for MSVC error LNK2019: unresolved external symbol __except1 referenced in function __ftol3_except. --- src/elements/core.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/elements/core.c b/src/elements/core.c index 04f2f085..d1a6cac3 100644 --- a/src/elements/core.c +++ b/src/elements/core.c @@ -17891,7 +17891,12 @@ uint64_t mdbx_key_from_jsonInteger(const int64_t json_integer) { const uint64_t key = biased_zero + (exponent << IEEE754_DOUBLE_MANTISSA_SIZE) + (mantissa - IEEE754_DOUBLE_IMPLICIT_LEAD); +#if !defined(_MSC_VER) || \ + defined( \ + _DEBUG) /* Workaround for MSVC error LNK2019: unresolved external \ + symbol __except1 referenced in function __ftol3_except */ assert(key == mdbx_key_from_double((double)json_integer)); +#endif /* Workaround for MSVC */ return key; } @@ -17913,7 +17918,12 @@ uint64_t mdbx_key_from_jsonInteger(const int64_t json_integer) { const uint64_t key = biased_zero - (exponent << IEEE754_DOUBLE_MANTISSA_SIZE) - (mantissa - IEEE754_DOUBLE_IMPLICIT_LEAD); +#if !defined(_MSC_VER) || \ + defined( \ + _DEBUG) /* Workaround for MSVC error LNK2019: unresolved external \ + symbol __except1 referenced in function __ftol3_except */ assert(key == mdbx_key_from_double((double)json_integer)); +#endif /* Workaround for MSVC */ return key; }