src/hb-blob.cc | 12 +++++++++--- src/hb-private.hh | 10 ++++++---- 2 files changed, 15 insertions(+), 7 deletions(-)
New commits: commit 058708a665cdd9e796581dbcf60a5778d3f5e240 Author: Behdad Esfahbod <beh...@behdad.org> Date: Thu Jul 5 13:16:00 2018 +0430 Allow disabling vector_size use diff --git a/src/hb-private.hh b/src/hb-private.hh index 91162f93..41e6c200 100644 --- a/src/hb-private.hh +++ b/src/hb-private.hh @@ -1108,10 +1108,12 @@ struct HbOpXor /* Compiler-assisted vectorization. */ /* The `vector_size' attribute was introduced in gcc 3.1. */ -#if defined( __GNUC__ ) && ( __GNUC__ >= 4 ) -#define HB_VECTOR_SIZE 128 -#elif !defined(HB_VECTOR_SIZE) -#define HB_VECTOR_SIZE 0 +#if !defined(HB_VECTOR_SIZE) +# if defined( __GNUC__ ) && ( __GNUC__ >= 4 ) +# define HB_VECTOR_SIZE 128 +# else +# define HB_VECTOR_SIZE 0 +# endif #endif /* Type behaving similar to vectorized vars defined using __attribute__((vector_size(...))). */ commit d8a7dedc83042c5a643195172830acf78f2e59ff Author: Ebrahim Byagowi <ebra...@gnu.org> Date: Wed Jul 4 15:33:39 2018 +0430 Use CreateFileW explicitly and pass wchar_t to it (#1087) diff --git a/src/hb-blob.cc b/src/hb-blob.cc index 61ed79a7..b509093e 100644 --- a/src/hb-blob.cc +++ b/src/hb-blob.cc @@ -569,9 +569,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; _______________________________________________ HarfBuzz mailing list HarfBuzz@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/harfbuzz