Skip to content

Commit e088c85

Browse files
committed
Enable C++20 support needed for Bitcoin core libraries.
Update Boost 1.83.0 since 1.81.0 does not work with cpp20.
1 parent f6214d5 commit e088c85

File tree

9 files changed

+21
-17
lines changed

9 files changed

+21
-17
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT CMAKE_HOST_APPLE)
8484
set(CMAKE_PLATFORM_HAS_INSTALLNAME FALSE)
8585
endif()
8686
enable_language(CXX)
87-
set(CMAKE_CXX_STANDARD 17)
87+
set(CMAKE_CXX_STANDARD 20)
8888
set(CMAKE_CXX_STANDARD_REQUIRED ON)
8989
set(CMAKE_CXX_EXTENSIONS OFF)
9090

depends/packages/bdb.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ define $(package)_set_vars
99
$(package)_config_opts=--disable-shared --enable-cxx --disable-replication
1010
$(package)_config_opts_mingw32=--enable-mingw
1111
$(package)_config_opts_linux=--with-pic
12-
$(package)_cxxflags=-std=c++11
12+
$(package)_cxxflags=-std=c++20
1313
$(package)_cc+=-Wno-error=implicit-function-declaration
1414
endef
1515

depends/packages/boost.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package=boost
2-
$(package)_version=1.81.0
2+
$(package)_version=1.83.0
33
$(package)_download_path=https://archives.boost.io/release/$($(package)_version)/source/
44
$(package)_file_name=boost_$(subst .,_,$($(package)_version)).tar.bz2
5-
$(package)_sha256_hash=71feeed900fbccca04a3b4f2f84a7c217186f28a940ed8b7ed4725986baf99fa
5+
$(package)_sha256_hash=6478edfe2f3305127cffe8caf73ea0176c53769f4bf1585be237eb30798c3b8e
66
$(package)_dependencies=native_b2
77
$(package)_patches=fix_boost_jam_cross-compilation.patch
88

@@ -21,7 +21,7 @@ $(package)_config_opts_i686_linux=address-model=32 architecture=x86
2121
$(package)_toolset_$(host_os)=gcc
2222
$(package)_archiver_$(host_os)=$($(package)_ar)
2323
$(package)_toolset_darwin=darwin
24-
$(package)_cxxflags=-std=c++17
24+
$(package)_cxxflags=-std=c++20
2525
$(package)_cxxflags_linux+=-fPIC
2626
$(package)_cxxflags_freebsd+=-fPIC
2727
$(package)_cxxflags_darwin+=-ffile-prefix-map=$($(package)_extract_dir)=/usr

depends/packages/qt.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ $(package)_config_opts_debug = -debug
5252
$(package)_config_opts = -no-egl
5353
$(package)_config_opts_debug += -optimized-tools
5454
$(package)_config_opts += -bindir $(build_prefix)/bin
55-
$(package)_config_opts += -c++std c++17
55+
$(package)_config_opts += -c++std c++20
5656
$(package)_config_opts += -confirm-license
5757
$(package)_config_opts += -no-cups
5858
$(package)_config_opts += -no-egl

depends/packages/zeromq.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ define $(package)_set_vars
1212
$(package)_config_opts += --disable-Werror --disable-drafts --enable-option-checking
1313
$(package)_config_opts_linux=--with-pic
1414
$(package)_config_opts_android=--with-pic
15-
$(package)_cxxflags=-std=c++17
15+
$(package)_cxxflags=-std=c++20
1616
ifdef GUIX_ENVIRONMENT
1717
$(package)_config_env_x86_64_darwin = LIB_LIBRARY_BACKUP="$(LIBRARY_PATH)" LIBRARY_PATH=""
1818
endif

src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2062,7 +2062,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
20622062
while (!fHaveGenesis) {
20632063
condvar_GenesisWait.wait(lock);
20642064
}
2065-
uiInterface.NotifyBlockTip.disconnect(BlockNotifyGenesisWait);
2065+
uiInterface.NotifyBlockTip.disconnect(&BlockNotifyGenesisWait);
20662066
}
20672067

20682068
// ********************************************************* Step 12: start node

src/secp256k1/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ set(${PROJECT_NAME}_LIB_VERSION_AGE 0)
4040
#=============================
4141
set(CMAKE_C_STANDARD 90)
4242
set(CMAKE_C_EXTENSIONS OFF)
43-
set(CMAKE_CXX_STANDARD 17)
43+
set(CMAKE_CXX_STANDARD 20)
4444
set(CMAKE_CXX_EXTENSIONS OFF)
4545

4646
#=============================

src/support/allocators/mt_pooled_secure.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ struct mt_pooled_secure_allocator : public std::allocator<T> {
2020
typedef std::allocator<T> base;
2121
typedef typename base::size_type size_type;
2222
typedef typename base::difference_type difference_type;
23-
typedef typename base::pointer pointer;
24-
typedef typename base::const_pointer const_pointer;
25-
typedef typename base::reference reference;
26-
typedef typename base::const_reference const_reference;
23+
24+
typedef T* pointer;
25+
typedef const T* const_pointer;
26+
typedef T& reference;
27+
typedef const T& const_reference;
28+
2729
typedef typename base::value_type value_type;
2830
mt_pooled_secure_allocator(size_type nrequested_size = 32,
2931
size_type nnext_size = 32,

src/support/allocators/pooled_secure.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ struct pooled_secure_allocator : public std::allocator<T> {
2525
typedef std::allocator<T> base;
2626
typedef typename base::size_type size_type;
2727
typedef typename base::difference_type difference_type;
28-
typedef typename base::pointer pointer;
29-
typedef typename base::const_pointer const_pointer;
30-
typedef typename base::reference reference;
31-
typedef typename base::const_reference const_reference;
28+
29+
typedef T* pointer;
30+
typedef const T* const_pointer;
31+
typedef T& reference;
32+
typedef const T& const_reference;
33+
3234
typedef typename base::value_type value_type;
3335
pooled_secure_allocator(const size_type nrequested_size = 32,
3436
const size_type nnext_size = 32,

0 commit comments

Comments
 (0)