Drop boost::scoped_array and simplify the code.
TCHAR
should be defined as wchar_t
if UNICODE
is defined. So we can use .toStdWString().c_str()
to get wchar_t C-style string.
Fix #13819
Drop boost::scoped_array and simplify the code.
TCHAR
should be defined as wchar_t
if UNICODE
is defined. So we can use .toStdWString().c_str()
to get wchar_t C-style string.
Fix #13819
Concept ACK
Thanks for removing Boost dependencies. Keep it coming! :-)
614@@ -625,7 +615,7 @@ bool SetStartOnSystemStartup(bool fAutoStart)
615 #ifndef UNICODE
616 psl->SetArguments(strArgs.toStdString().c_str());
617 #else
UNICODE
is only defined for Windows? (if that’s the case)
Should the reference also be removed from test/lint/lint-includes.sh
?
Tested that make
still works on macOS.
Tested the gitian binary on a Windows 10 VM, by launching with bitcoin-qt -wallet=你好
, assuming that was the problem? This leads to a crash, but that’s also the case on master:
I have a version from earlier this year where it leads to a slightly nicer crash:
(seems unrelated, so I made a ticket #13754)
bitcoin-qt -wallet=test
works fine by the way, maybe that was all.
554
555 if (SUCCEEDED(hres))
556 {
557 // Get the current executable path
558- TCHAR pszExePath[MAX_PATH];
559- GetModuleFileName(nullptr, pszExePath, sizeof(pszExePath));
make
still works on macOS with 5d70ab0. I have no opinion on the code itself, other than it seems good to keep making progress here: https://github.com/bitcoin/bitcoin/projects/3#card-205363
Tested that for commit 6031f7f (master and this pull) I can launch regtest and testnet after re-login for a user with only ascii character in the name.
(See lower left of screenshot, Compare to #5793 (comment))
Now it fails for commit d41914b (master and this pull) that it can not write to the directory:
(though the folders are created, as can be seen in the explorer in the background)
555 if (SUCCEEDED(hres))
556 {
557 // Get the current executable path
558- TCHAR pszExePath[MAX_PATH];
559- GetModuleFileName(nullptr, pszExePath, sizeof(pszExePath));
560+ wchar_t pszExePath[MAX_PATH];
WCHAR
here, as I’m seeing differing descriptions of its definition, e.g. unsigned wchar_t
here: https://docs.microsoft.com/en-us/windows/desktop/intl/windows-data-types-for-strings
1117@@ -1118,9 +1118,9 @@ void AllocateFileRange(FILE *file, unsigned int offset, unsigned int length) {
1118 #ifdef WIN32
1119 fs::path GetSpecialFolderPath(int nFolder, bool fCreate)
1120 {
1121- char pszPath[MAX_PATH] = "";
1122+ wchar_t pszPath[MAX_PATH] = L"";
WCHAR
seems preferable.
1117@@ -1118,9 +1118,9 @@ void AllocateFileRange(FILE *file, unsigned int offset, unsigned int length) {
1118 #ifdef WIN32
1119 fs::path GetSpecialFolderPath(int nFolder, bool fCreate)
1120 {
1121- char pszPath[MAX_PATH] = "";
1122+ WCHAR pszPath[MAX_PATH] = L"";
1123
1124- if(SHGetSpecialFolderPathA(nullptr, pszPath, nFolder, fCreate))
1125+ if(SHGetSpecialFolderPathW(nullptr, pszPath, nFolder, fCreate))
SHGetSpecialFolderPathA
nice cleanup, too
utACK bb6ca65f9890e8280ace32de5a37774e14705859
ken2812221
fanquake
practicalswift
MarcoFalke
Sjors
Empact
DrahtBot
laanwj
Milestone
0.18.0