diff --git a/builds/cmake/CMakeLists.txt b/builds/cmake/CMakeLists.txt index c39ed1cfbc..b3456fc0ef 100644 --- a/builds/cmake/CMakeLists.txt +++ b/builds/cmake/CMakeLists.txt @@ -376,7 +376,7 @@ endif() # Find secp256k1 #------------------------------------------------------------------------------ -find_package( Secp256K1 0.1.0.20 REQUIRED ) +find_package( Secp256K1 0.5.1.0 REQUIRED ) # Define project common includes for build. #------------------------------------------------------------------------------ diff --git a/builds/msvc/vs2022/libbitcoin-system-examples/libbitcoin-system-examples.vcxproj b/builds/msvc/vs2022/libbitcoin-system-examples/libbitcoin-system-examples.vcxproj index 06558a900a..ecdc0c78a4 100644 --- a/builds/msvc/vs2022/libbitcoin-system-examples/libbitcoin-system-examples.vcxproj +++ b/builds/msvc/vs2022/libbitcoin-system-examples/libbitcoin-system-examples.vcxproj @@ -138,7 +138,7 @@ - + @@ -150,7 +150,7 @@ - + diff --git a/builds/msvc/vs2022/libbitcoin-system-examples/packages.config b/builds/msvc/vs2022/libbitcoin-system-examples/packages.config index 7c64087077..698197f612 100644 --- a/builds/msvc/vs2022/libbitcoin-system-examples/packages.config +++ b/builds/msvc/vs2022/libbitcoin-system-examples/packages.config @@ -12,5 +12,5 @@ - + diff --git a/builds/msvc/vs2022/libbitcoin-system-test/libbitcoin-system-test.vcxproj b/builds/msvc/vs2022/libbitcoin-system-test/libbitcoin-system-test.vcxproj index 034c8c48fc..84c60addb4 100644 --- a/builds/msvc/vs2022/libbitcoin-system-test/libbitcoin-system-test.vcxproj +++ b/builds/msvc/vs2022/libbitcoin-system-test/libbitcoin-system-test.vcxproj @@ -409,7 +409,7 @@ - + @@ -422,7 +422,7 @@ - + diff --git a/builds/msvc/vs2022/libbitcoin-system-test/packages.config b/builds/msvc/vs2022/libbitcoin-system-test/packages.config index a328fc1f8e..9237b81691 100644 --- a/builds/msvc/vs2022/libbitcoin-system-test/packages.config +++ b/builds/msvc/vs2022/libbitcoin-system-test/packages.config @@ -12,6 +12,6 @@ - + diff --git a/builds/msvc/vs2022/libbitcoin-system/libbitcoin-system.vcxproj b/builds/msvc/vs2022/libbitcoin-system/libbitcoin-system.vcxproj index f60c785e59..8da83430de 100644 --- a/builds/msvc/vs2022/libbitcoin-system/libbitcoin-system.vcxproj +++ b/builds/msvc/vs2022/libbitcoin-system/libbitcoin-system.vcxproj @@ -705,7 +705,7 @@ - + @@ -717,7 +717,7 @@ - + diff --git a/builds/msvc/vs2022/libbitcoin-system/packages.config b/builds/msvc/vs2022/libbitcoin-system/packages.config index 7c64087077..698197f612 100644 --- a/builds/msvc/vs2022/libbitcoin-system/packages.config +++ b/builds/msvc/vs2022/libbitcoin-system/packages.config @@ -12,5 +12,5 @@ - + diff --git a/configure.ac b/configure.ac index 4b22104c8a..e14773d006 100644 --- a/configure.ac +++ b/configure.ac @@ -485,13 +485,13 @@ AS_CASE([${host_os}], AC_MSG_NOTICE([dl_LIBS : ${dl_LIBS}]) -# Require secp256k1 of at least version 0.1.0.20 and output ${secp256k1_CPPFLAGS/LIBS/PKG}. +# Require secp256k1 of at least version 0.5.1.0 and output ${secp256k1_CPPFLAGS/LIBS/PKG}. #------------------------------------------------------------------------------ -PKG_CHECK_MODULES([secp256k1], [libsecp256k1 >= 0.1.0.20], - [secp256k1_INCLUDEDIR="`$PKG_CONFIG --variable=includedir "libsecp256k1 >= 0.1.0.20" 2>/dev/null`" - secp256k1_OTHER_CFLAGS="`$PKG_CONFIG --cflags-only-other "libsecp256k1 >= 0.1.0.20" 2>/dev/null`"], - [AC_MSG_ERROR([libsecp256k1 >= 0.1.0.20 is required but was not found.])]) -AC_SUBST([secp256k1_PKG], ['libsecp256k1 >= 0.1.0.20']) +PKG_CHECK_MODULES([secp256k1], [libsecp256k1 >= 0.5.1.0], + [secp256k1_INCLUDEDIR="`$PKG_CONFIG --variable=includedir "libsecp256k1 >= 0.5.1.0" 2>/dev/null`" + secp256k1_OTHER_CFLAGS="`$PKG_CONFIG --cflags-only-other "libsecp256k1 >= 0.5.1.0" 2>/dev/null`"], + [AC_MSG_ERROR([libsecp256k1 >= 0.5.1.0 is required but was not found.])]) +AC_SUBST([secp256k1_PKG], ['libsecp256k1 >= 0.5.1.0']) AC_SUBST([secp256k1_CPPFLAGS], [${secp256k1_CFLAGS}]) AS_IF([test x${secp256k1_INCLUDEDIR} != "x"], [AC_SUBST([secp256k1_ISYS_CPPFLAGS], ["-isystem${secp256k1_INCLUDEDIR} ${secp256k1_OTHER_CFLAGS}"])], diff --git a/include/bitcoin/system.hpp b/include/bitcoin/system.hpp index 3a9f0209fd..3cc79691c6 100755 --- a/include/bitcoin/system.hpp +++ b/include/bitcoin/system.hpp @@ -86,6 +86,7 @@ #include #include #include +#include #include #include #include diff --git a/include/bitcoin/system/allocator.hpp b/include/bitcoin/system/allocator.hpp index 88d9c1f0cd..e6b884e2f9 100644 --- a/include/bitcoin/system/allocator.hpp +++ b/include/bitcoin/system/allocator.hpp @@ -118,7 +118,12 @@ class allocator auto ptr = allocate_object(); construct_guard guard{ arena_, ptr }; construct(ptr, std::forward(args)...); + + // Bogus warning (under LTCG only). + BC_PUSH_WARNING(UNREACHABLE_CODE) guard.arena_ = nullptr; + BC_POP_WARNING() + return ptr; } diff --git a/include/bitcoin/system/warnings.hpp b/include/bitcoin/system/warnings.hpp index 2bae64b1c0..3f5d7d98f0 100644 --- a/include/bitcoin/system/warnings.hpp +++ b/include/bitcoin/system/warnings.hpp @@ -44,6 +44,7 @@ #define THROW_FROM_NOEXCEPT 4297 #define TRUNCATED_CONSTANT 4310 #define LOCAL_VARIABLE_NOT_INITIALIZED 4700 + #define UNREACHABLE_CODE 4702 #define NOT_INLINED 4714 #define DISCARDING_NON_DISCARDABLE 4834 diff --git a/libbitcoin-system.pc.in b/libbitcoin-system.pc.in index 3c769344ed..3df2d15440 100644 --- a/libbitcoin-system.pc.in +++ b/libbitcoin-system.pc.in @@ -25,7 +25,7 @@ Version: @PACKAGE_VERSION@ #============================================================================== # Dependencies that publish package configuration. #------------------------------------------------------------------------------ -Requires: @icu_i18n_PKG@ libsecp256k1 >= 0.1.0.20 +Requires: @icu_i18n_PKG@ libsecp256k1 >= 0.5.1.0 # Include directory and any other required compiler flags. #------------------------------------------------------------------------------