Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,27 @@

cmake_minimum_required(VERSION 3.12)

# CMake 4.x removed compatibility with cmake_minimum_required(<3.5), which
# several bundled subprojects (bls, secp256k1, leveldb, univalue, qt) still
# declare. Allow them to configure under modern CMake.
if(NOT DEFINED CMAKE_POLICY_VERSION_MINIMUM)
set(CMAKE_POLICY_VERSION_MINIMUM 3.5)
endif()

project(devault
VERSION 1.2.1
# DESCRIPTION "DeVault is a full node implementation of the DeVault protocol."
# HOMEPAGE_URL "https://www.devault.cc"
)

# Modern libstdc++ (GCC 13+) no longer transitively includes many standard
# headers (<cstdint>, <stdexcept>, containers, ...) that this 2019-era code
# relied on. Force-include a small compatibility prelude into every C++ TU
# instead of editing hundreds of files.
add_compile_options(
"$<$<COMPILE_LANGUAGE:CXX>:-include;${CMAKE_CURRENT_SOURCE_DIR}/src/compat/modern_prelude.h>"
)

enable_testing()

# Package information
Expand Down
6 changes: 4 additions & 2 deletions cmake/modules/FindBerkeleyDB.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,21 @@ find_brew_prefix(BREW_HINT berkeley-db)

find_path(BDB_INCLUDE_DIR
NAMES db.h
PATH_SUFFIXES db5.3 db5 db4.8 db4
HINTS ${BREW_HINT}
)
find_library(BDB_LIBRARY
NAMES db libdb
NAMES db libdb db-5.3 db-5 db-4.8
HINTS ${BREW_HINT}
)

find_path(BDBXX_INCLUDE_DIR
NAMES db_cxx.h
PATH_SUFFIXES db5.3 db5 db4.8 db4
HINTS ${BREW_HINT}
)
find_library(BDBXX_LIBRARY
NAMES db_cxx libdb_cxx
NAMES db_cxx libdb_cxx db_cxx-5.3 db_cxx-5 db_cxx-4.8
HINTS ${BREW_HINT}
)

Expand Down
5 changes: 4 additions & 1 deletion cmake/modules/FindMiniupnpc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ if(MINIUPNPC_INCLUDE_DIR)
set(CMAKE_REQUIRED_INCLUDES ${MINIUPNPC_INCLUDE_DIR})
foreach(_miniupnpc_header ${MINIUPNPC_REQUIRED_HEADERS})
sanitize_variable(HAVE_MINIUPNPC_ ${_miniupnpc_header} HEADER_FOUND)
check_include_files(${_miniupnpc_header} ${HEADER_FOUND})
# Prepend stddef.h: newer miniupnpc headers (2.3.x) reference size_t
# without including it, which would otherwise fail this self-compile
# check and wrongly mark miniupnpc as missing.
check_include_files("stddef.h;${_miniupnpc_header}" ${HEADER_FOUND})
if(NOT ${HEADER_FOUND})
set(MINIUPNPC_MISSING_HEADER ON)
endif()
Expand Down
36 changes: 36 additions & 0 deletions src/compat/modern_prelude.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Compatibility prelude force-included for all C++ TUs (see top-level
// CMAKE_CXX_FLAGS "-include"). Modern libstdc++ (GCC 13+) no longer pulls
// these in transitively the way the 2019-era code assumed. Including the
// common set here once avoids sprinkling includes across the tree (and
// avoids many slow rebuild cycles) just to build on a current toolchain.
#ifndef DEVAULT_COMPAT_MODERN_PRELUDE_H
#define DEVAULT_COMPAT_MODERN_PRELUDE_H

// C library shims
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cstddef>
#include <climits>

// Common utilities
#include <stdexcept>
#include <limits>
#include <memory>
#include <utility>
#include <algorithm>
#include <functional>
#include <iterator>

// Common containers
#include <array>
#include <vector>
#include <deque>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <string>

#endif // DEVAULT_COMPAT_MODERN_PRELUDE_H
6 changes: 6 additions & 0 deletions src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1420,7 +1420,13 @@ static void ThreadMapPort() {
struct IGDdatas data;
int r;

#if MINIUPNPC_API_VERSION >= 18
char wanaddr[64];
r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr),
wanaddr, sizeof(wanaddr));
#else
r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr));
#endif
if (r == 1) {
if (fDiscover) {
char externalIPAddress[40];
Expand Down
1 change: 1 addition & 0 deletions src/support/lockedpool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#endif

#include <algorithm>
#include <stdexcept>

LockedPoolManager *LockedPoolManager::_instance = nullptr;
std::once_flag LockedPoolManager::init_flag;
Expand Down
2 changes: 2 additions & 0 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@
#include <dstencode.h> // Temporary

#include <atomic>
#include <deque>
#include <future>
#include <queue>
#include <sstream>
#include <thread>

Expand Down