aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2021-08-26 16:16:35 +0800
committerfanquake <fanquake@gmail.com>2021-08-26 16:20:52 +0800
commit3a62b8b77e7b1b08c251551e3cf528f94c3392f8 (patch)
treefb2b47c91dd5209807cd536e1c6e1059f2ca831e /src
parent718d9f2f77270303b2f95dc275cbf416dfd4567b (diff)
parentacb7aad27ec8a184808aa7905887e3b2c5d54e9c (diff)
downloadbitcoin-3a62b8b77e7b1b08c251551e3cf528f94c3392f8.tar.xz
Merge bitcoin/bitcoin#22713: Fix build with Boost 1.77.0
acb7aad27ec8a184808aa7905887e3b2c5d54e9c Fix build with Boost 1.77.0 (Rafael Sadowski) Pull request description: BOOST_FILESYSTEM_C_STR changed to accept the path as an argument. ACKs for top commit: hebasto: ACK acb7aad27ec8a184808aa7905887e3b2c5d54e9c benthecarman: ACK acb7aad27ec8a184808aa7905887e3b2c5d54e9c fanquake: ACK acb7aad27ec8a184808aa7905887e3b2c5d54e9c - tested the fix with Boost 1.77.0 and 1.71.0. Tree-SHA512: c25fcb56971ee7a448cfb074f8a13696b32c16c63f81076f8a76911f93aa849c8f3637555b0b4215fa0d8b958641d7e4e60d10e103b833545cbc6b1f4009b526
Diffstat (limited to 'src')
-rw-r--r--src/fs.cpp4
-rw-r--r--src/wallet/test/db_tests.cpp4
-rw-r--r--src/wallet/test/init_test_fixture.cpp4
3 files changed, 12 insertions, 0 deletions
diff --git a/src/fs.cpp b/src/fs.cpp
index 4f20ca4d28..89c7ad27dc 100644
--- a/src/fs.cpp
+++ b/src/fs.cpp
@@ -242,7 +242,11 @@ void ofstream::close()
}
#else // __GLIBCXX__
+#if BOOST_VERSION >= 107700
+static_assert(sizeof(*BOOST_FILESYSTEM_C_STR(fs::path())) == sizeof(wchar_t),
+#else
static_assert(sizeof(*fs::path().BOOST_FILESYSTEM_C_STR) == sizeof(wchar_t),
+#endif // BOOST_VERSION >= 107700
"Warning: This build is using boost::filesystem ofstream and ifstream "
"implementations which will fail to open paths containing multibyte "
"characters. You should delete this static_assert to ignore this warning, "
diff --git a/src/wallet/test/db_tests.cpp b/src/wallet/test/db_tests.cpp
index 17f5264b45..16cb7e0baf 100644
--- a/src/wallet/test/db_tests.cpp
+++ b/src/wallet/test/db_tests.cpp
@@ -25,7 +25,11 @@ BOOST_AUTO_TEST_CASE(getwalletenv_file)
std::string test_name = "test_name.dat";
const fs::path datadir = gArgs.GetDataDirNet();
fs::path file_path = datadir / test_name;
+#if BOOST_VERSION >= 107700
+ std::ofstream f(BOOST_FILESYSTEM_C_STR(file_path));
+#else
std::ofstream f(file_path.BOOST_FILESYSTEM_C_STR);
+#endif // BOOST_VERSION >= 107700
f.close();
std::string filename;
diff --git a/src/wallet/test/init_test_fixture.cpp b/src/wallet/test/init_test_fixture.cpp
index dd9354848d..53c972c46d 100644
--- a/src/wallet/test/init_test_fixture.cpp
+++ b/src/wallet/test/init_test_fixture.cpp
@@ -32,7 +32,11 @@ InitWalletDirTestingSetup::InitWalletDirTestingSetup(const std::string& chainNam
fs::create_directories(m_walletdir_path_cases["default"]);
fs::create_directories(m_walletdir_path_cases["custom"]);
fs::create_directories(m_walletdir_path_cases["relative"]);
+#if BOOST_VERSION >= 107700
+ std::ofstream f(BOOST_FILESYSTEM_C_STR(m_walletdir_path_cases["file"]));
+#else
std::ofstream f(m_walletdir_path_cases["file"].BOOST_FILESYSTEM_C_STR);
+#endif // BOOST_VERSION >= 107700
f.close();
}