aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2022-09-09 12:54:30 -0500
committerluigi1111 <luigi1111w@gmail.com>2022-09-09 12:54:30 -0500
commit87a4b37497012564fc9c8ede97855527701dd74b (patch)
tree821e0e3a26ef33c0df08e4b9d8b0a409c568e76b /contrib
parentMerge pull request #8538 (diff)
parentWindows: fix unicode file path support (diff)
downloadmonero-87a4b37497012564fc9c8ede97855527701dd74b.tar.xz
Merge pull request #8547
e410ab7 Windows: fix unicode file path support (tobtoht)
Diffstat (limited to 'contrib')
-rw-r--r--contrib/epee/src/file_io_utils.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/epee/src/file_io_utils.cpp b/contrib/epee/src/file_io_utils.cpp
index a8348431c..c0798a510 100644
--- a/contrib/epee/src/file_io_utils.cpp
+++ b/contrib/epee/src/file_io_utils.cpp
@@ -29,7 +29,7 @@
#include <fstream>
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/operations.hpp>
-#ifdef WIN32
+#ifdef _WIN32
#include <windows.h>
#include "string_tools.h"
#endif
@@ -70,7 +70,7 @@ namespace file_io_utils
bool save_string_to_file(const std::string& path_to_file, const std::string& str)
{
-#ifdef WIN32
+#ifdef _WIN32
std::wstring wide_path;
try { wide_path = string_tools::utf8_to_utf16(path_to_file); } catch (...) { return false; }
HANDLE file_handle = CreateFileW(wide_path.c_str(), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
@@ -104,7 +104,7 @@ namespace file_io_utils
bool load_file_to_string(const std::string& path_to_file, std::string& target_str, size_t max_size)
{
-#ifdef WIN32
+#ifdef _WIN32
std::wstring wide_path;
try { wide_path = string_tools::utf8_to_utf16(path_to_file); } catch (...) { return false; }
HANDLE file_handle = CreateFileW(wide_path.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
@@ -153,7 +153,7 @@ namespace file_io_utils
bool get_file_size(const std::string& path_to_file, uint64_t &size)
{
-#ifdef WIN32
+#ifdef _WIN32
std::wstring wide_path;
try { wide_path = string_tools::utf8_to_utf16(path_to_file); } catch (...) { return false; }
HANDLE file_handle = CreateFileW(wide_path.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);