build: fix compilation on modern toolchains using ai#327
Open
pppest wants to merge 1 commit into
Open
Conversation
…npc 2.3) The 2019-era code no longer builds on current Linux toolchains. Changes: * CMakeLists.txt: set CMAKE_POLICY_VERSION_MINIMUM=3.5 so bundled subprojects (bls, secp256k1, leveldb, univalue, qt) that declare cmake_minimum_required(<3.5) still configure under CMake 4.x, which removed that compatibility. * src/compat/modern_prelude.h (new) + force-include via CMakeLists.txt: modern libstdc++ (GCC 13+) no longer transitively pulls in <cstdint>, <stdexcept>, container headers, etc. A small force-included prelude fixes this tree-wide instead of editing hundreds of files. * cmake/modules/FindBerkeleyDB.cmake: also search db5.x include path suffixes and version-suffixed library names (libdb_cxx-5.3), as used by current distros. * cmake/modules/FindMiniupnpc.cmake: prepend stddef.h to the header self-compile check. miniupnpc 2.3.x headers reference size_t without including it, which otherwise wrongly marked miniupnpc as missing and broke linking. * src/net.cpp: use the 7-argument UPNP_GetValidIGD signature (added wanaddr/wanaddrlen) for MINIUPNPC_API_VERSION >= 18. * src/support/lockedpool.cpp, src/validation.cpp: add explicit standard includes that were previously available only transitively. Result: a clean `cmake .. && make` builds devaultd, devault-cli, devault-tx and devault-qt with no extra flags. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
used ai to fix build errors, ai slob below:
build: fix compilation on modern toolchains (GCC 13+, CMake 4, miniupc 2.3)
The 2019-era code no longer builds on current Linux toolchains. Changes:
CMakeLists.txt: set CMAKE_POLICY_VERSION_MINIMUM=3.5 so bundled subprojects (bls, secp256k1, leveldb, univalue, qt) that declare cmake_minimum_required(<3.5) still configure under CMake 4.x, which removed that compatibility.
src/compat/modern_prelude.h (new) + force-include via CMakeLists.txt: modern libstdc++ (GCC 13+) no longer transitively pulls in , , container headers, etc. A small force-included prelude fixes this tree-wide instead of editing hundreds of files.
cmake/modules/FindBerkeleyDB.cmake: also search db5.x include path suffixes and version-suffixed library names (libdb_cxx-5.3), as used by current distros.
cmake/modules/FindMiniupnpc.cmake: prepend stddef.h to the header self-compile check. miniupnpc 2.3.x headers reference size_t without including it, which otherwise wrongly marked miniupnpc as missing and broke linking.
src/net.cpp: use the 7-argument UPNP_GetValidIGD signature (added wanaddr/wanaddrlen) for MINIUPNPC_API_VERSION >= 18.
src/support/lockedpool.cpp, src/validation.cpp: add explicit standard includes that were previously available only transitively.
Result: a clean
cmake .. && makebuilds devaultd, devault-cli, devault-tx and devault-qt with no extra flags.