mirror of
https://github.com/wownero/lwsf-wow.git
synced 2026-10-17 07:21:28 +02:00
Changes need to build on ios (particularly older targets)
This commit is contained in:
+1
-1
@@ -56,7 +56,7 @@ if(STATIC)
|
|||||||
set(Boost_USE_STATIC_LIBS ON)
|
set(Boost_USE_STATIC_LIBS ON)
|
||||||
set(Boost_USE_STATIC_RUNTIME ON)
|
set(Boost_USE_STATIC_RUNTIME ON)
|
||||||
endif()
|
endif()
|
||||||
find_package(Boost 1.66 QUIET REQUIRED COMPONENTS program_options thread)
|
find_package(Boost 1.66 QUIET REQUIRED COMPONENTS filesystem program_options thread)
|
||||||
|
|
||||||
list(INSERT CMAKE_MODULE_PATH 0
|
list(INSERT CMAKE_MODULE_PATH 0
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||||
|
|||||||
+2
-1
@@ -71,7 +71,7 @@ if (NOT ("${LWSF_POLYSEED_SOURCE}" STREQUAL ""))
|
|||||||
set(LWSF_POLYSEED_LIBRARY polyseed)
|
set(LWSF_POLYSEED_LIBRARY polyseed)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_compile_definitions(lwsf-api PRIVATE ${LWSF_COMPILE_DEFINITIONS})
|
target_compile_definitions(lwsf-api PUBLIC ${LWSF_COMPILE_DEFINITIONS})
|
||||||
target_include_directories(lwsf-api
|
target_include_directories(lwsf-api
|
||||||
PUBLIC
|
PUBLIC
|
||||||
"${lwsf_SOURCE_DIR}/include"
|
"${lwsf_SOURCE_DIR}/include"
|
||||||
@@ -88,6 +88,7 @@ target_link_libraries(lwsf-api
|
|||||||
lwsf-wire-json
|
lwsf-wire-json
|
||||||
lwsf-wire-msgpack
|
lwsf-wire-msgpack
|
||||||
lwsf-wire-wrapper
|
lwsf-wire-wrapper
|
||||||
|
${Boost_FILESYSTEM_LIBRARY}
|
||||||
${Boost_THREAD_LIBRARY}
|
${Boost_THREAD_LIBRARY}
|
||||||
${sodium_LIBRARY_RELEASE}
|
${sodium_LIBRARY_RELEASE}
|
||||||
${LWSF_POLYSEED_LIBRARY}
|
${LWSF_POLYSEED_LIBRARY}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
#include "pending_transaction.h"
|
#include "pending_transaction.h"
|
||||||
|
|
||||||
#include <filesystem>
|
#include <boost/filesystem/operations.hpp>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include "backend.h"
|
#include "backend.h"
|
||||||
@@ -172,7 +172,7 @@ namespace lwsf { namespace internal
|
|||||||
if (filename.empty())
|
if (filename.empty())
|
||||||
return send();
|
return send();
|
||||||
|
|
||||||
if (std::filesystem::exists(filename) && !overwrite)
|
if (boost::filesystem::exists(filename) && !overwrite)
|
||||||
{
|
{
|
||||||
error_ = "File already exists";
|
error_ = "File already exists";
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
+15
-15
@@ -33,9 +33,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <boost/filesystem.hpp>
|
||||||
#include <boost/range/combine.hpp>
|
#include <boost/range/combine.hpp>
|
||||||
#include <exception>
|
#include <exception>
|
||||||
#include <filesystem>
|
|
||||||
#include <sodium/core.h>
|
#include <sodium/core.h>
|
||||||
#include <sodium/randombytes.h>
|
#include <sodium/randombytes.h>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@@ -181,7 +181,7 @@ namespace lwsf { namespace internal
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined (__unix__) || (defined (__APPLE__) && defined (__MACH__))
|
#if defined (__unix__) || (defined (__APPLE__) && defined (__MACH__))
|
||||||
bool atomic_file_write(const std::filesystem::path& filename, const std::filesystem::path& directory, epee::byte_slice contents) noexcept
|
bool atomic_file_write(const boost::filesystem::path& filename, const boost::filesystem::path& directory, epee::byte_slice contents) noexcept
|
||||||
{
|
{
|
||||||
const int fd =
|
const int fd =
|
||||||
open(filename.c_str(), O_WRONLY | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
|
open(filename.c_str(), O_WRONLY | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
|
||||||
@@ -387,14 +387,14 @@ namespace lwsf { namespace internal
|
|||||||
std::vector<std::string> wallet::find(const std::string& path)
|
std::vector<std::string> wallet::find(const std::string& path)
|
||||||
{
|
{
|
||||||
std::vector<std::string> out;
|
std::vector<std::string> out;
|
||||||
std::filesystem::path work_dir(path);
|
boost::filesystem::path work_dir(path);
|
||||||
if(!std::filesystem::is_directory(path))
|
if(!boost::filesystem::is_directory(path))
|
||||||
return out;
|
return out;
|
||||||
|
|
||||||
std::filesystem::recursive_directory_iterator end_itr;
|
boost::filesystem::recursive_directory_iterator end_itr;
|
||||||
for (std::filesystem::recursive_directory_iterator itr(path); itr != end_itr; ++itr)
|
for (boost::filesystem::recursive_directory_iterator itr(path); itr != end_itr; ++itr)
|
||||||
{
|
{
|
||||||
if (std::filesystem::is_regular_file(itr->status()))
|
if (boost::filesystem::is_regular_file(itr->status()))
|
||||||
{
|
{
|
||||||
std::string filename = itr->path().filename().string();
|
std::string filename = itr->path().filename().string();
|
||||||
if (!try_load(filename, wallet_file_magic).empty())
|
if (!try_load(filename, wallet_file_magic).empty())
|
||||||
@@ -753,13 +753,13 @@ namespace lwsf { namespace internal
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
const std::filesystem::path file = real_path;
|
const boost::filesystem::path file = real_path;
|
||||||
const std::filesystem::path new_file = real_path + ".new";
|
const boost::filesystem::path new_file = real_path + ".new";
|
||||||
const std::filesystem::path directory =
|
const boost::filesystem::path directory =
|
||||||
std::filesystem::path{real_path}.remove_filename();
|
boost::filesystem::path{real_path}.remove_filename();
|
||||||
|
|
||||||
if (std::filesystem::exists(new_file))
|
if (boost::filesystem::exists(new_file))
|
||||||
std::filesystem::rename(new_file, file);
|
boost::filesystem::rename(new_file, file);
|
||||||
|
|
||||||
// blocks until file and directory contents are synced
|
// blocks until file and directory contents are synced
|
||||||
epee::byte_slice blob =
|
epee::byte_slice blob =
|
||||||
@@ -767,7 +767,7 @@ namespace lwsf { namespace internal
|
|||||||
if (!atomic_file_write(new_file, directory, std::move(blob)))
|
if (!atomic_file_write(new_file, directory, std::move(blob)))
|
||||||
throw std::runtime_error{"Failed to write file " + real_path};
|
throw std::runtime_error{"Failed to write file " + real_path};
|
||||||
|
|
||||||
std::filesystem::rename(new_file, file);
|
boost::filesystem::rename(new_file, file);
|
||||||
}
|
}
|
||||||
catch (const std::exception& e)
|
catch (const std::exception& e)
|
||||||
{
|
{
|
||||||
@@ -816,7 +816,7 @@ namespace lwsf { namespace internal
|
|||||||
// Configure SSL certificate verification
|
// Configure SSL certificate verification
|
||||||
if (options.support != epee::net_utils::ssl_support_t::e_ssl_support_disabled)
|
if (options.support != epee::net_utils::ssl_support_t::e_ssl_support_disabled)
|
||||||
{
|
{
|
||||||
bool ca_file_valid = !ca_file_path_.empty() && std::filesystem::exists(ca_file_path_);
|
bool ca_file_valid = !ca_file_path_.empty() && boost::filesystem::exists(ca_file_path_);
|
||||||
|
|
||||||
if (ca_file_valid) {
|
if (ca_file_valid) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user