summaryrefslogtreecommitdiff
path: root/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.cc
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.cc')
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.cc
index 98e9c65c23d..5bab1abbe9a 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.cc
@@ -31,7 +31,6 @@
#endif
#include "hb-private.hh"
-#include "hb-debug.hh"
#include "hb-blob-private.hh"
#ifdef HAVE_SYS_MMAN_H
@@ -508,6 +507,7 @@ struct hb_mapped_file_t
#endif
};
+#if (defined(HAVE_MMAP) || defined(_WIN32) || defined(__CYGWIN__)) && !defined(HB_NO_MMAP)
static void
_hb_mapped_file_destroy (hb_mapped_file_t *file)
{
@@ -522,6 +522,7 @@ _hb_mapped_file_destroy (hb_mapped_file_t *file)
free (file);
}
+#endif
/**
* hb_blob_create_from_file:
@@ -567,9 +568,15 @@ fail_without_close:
hb_mapped_file_t *file = (hb_mapped_file_t *) calloc (1, sizeof (hb_mapped_file_t));
if (unlikely (!file)) return hb_blob_get_empty ();
- HANDLE fd = CreateFile (file_name, GENERIC_READ, FILE_SHARE_READ, nullptr,
- OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL|FILE_FLAG_OVERLAPPED,
- nullptr);
+ HANDLE fd;
+ unsigned int size = strlen (file_name) + 1;
+ wchar_t * wchar_file_name = (wchar_t *) malloc (sizeof (wchar_t) * size);
+ if (unlikely (wchar_file_name == nullptr)) goto fail_without_close;
+ mbstowcs (wchar_file_name, file_name, size);
+ fd = CreateFileW (wchar_file_name, GENERIC_READ, FILE_SHARE_READ, nullptr,
+ OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL|FILE_FLAG_OVERLAPPED,
+ nullptr);
+ free (wchar_file_name);
if (unlikely (fd == INVALID_HANDLE_VALUE)) goto fail_without_close;