diff --git a/cmake/StaticBuild.cmake b/cmake/StaticBuild.cmake index c0cb4ba58..3ea99cbc7 100644 --- a/cmake/StaticBuild.cmake +++ b/cmake/StaticBuild.cmake @@ -406,8 +406,12 @@ build_external(hidapi ) set(HIDAPI_FOUND TRUE) add_static_target(hidapi_libusb hidapi_external ${hidapi_libusb_lib}) +set(hidapi_links "libusb_vendor;libudev") +if(WIN32) + list(APPEND hidapi_links setupapi) +endif() set_target_properties(hidapi_libusb PROPERTIES - INTERFACE_LINK_LIBRARIES "libusb_vendor;libudev" + INTERFACE_LINK_LIBRARIES "${hidapi_links}" INTERFACE_COMPILE_DEFINITIONS HAVE_HIDAPI) diff --git a/src/common/file.cpp b/src/common/file.cpp index 3d691776e..e47088434 100644 --- a/src/common/file.cpp +++ b/src/common/file.cpp @@ -35,6 +35,7 @@ #include #ifdef WIN32 +#include "string_tools.h" #ifndef STRSAFE_NO_DEPRECATE #define STRSAFE_NO_DEPRECATE #endif @@ -284,7 +285,7 @@ namespace tools { { try { - return string_tools::utf16_to_utf8(psz_path); + return epee::string_tools::utf16_to_utf8(psz_path); } catch (const std::exception &e) { @@ -352,10 +353,10 @@ namespace tools { #if defined(WIN32) // Maximizing chances for success std::wstring wide_replacement_name; - try { wide_replacement_name = string_tools::utf8_to_utf16(old_name); } + try { wide_replacement_name = epee::string_tools::utf8_to_utf16(old_name); } catch (...) { return std::error_code(GetLastError(), std::system_category()); } std::wstring wide_replaced_name; - try { wide_replaced_name = string_tools::utf8_to_utf16(new_name); } + try { wide_replaced_name = epee::string_tools::utf8_to_utf16(new_name); } catch (...) { return std::error_code(GetLastError(), std::system_category()); } DWORD attributes = ::GetFileAttributesW(wide_replaced_name.c_str()); diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index af99a9098..09b5c9573 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -6006,8 +6006,8 @@ void wallet2::store_to(const std::string &path, const epee::wipeable_string &pas bool success = false; try { serialization::binary_string_archiver oar; - serialization::serialize(oar, cache_file_data.get()); - success = save_to_file(new_file, oss.str()); + serialization::serialize(oar, *cache_file_data); + success = save_to_file(new_file, oar.str()); } catch (...) {} THROW_WALLET_EXCEPTION_IF(!success, error::file_save_error, new_file); #else