Merge pull request #1380 from kbrow1i/cygwin

Don't use Win32 API on Cygwin
This commit is contained in:
Behdad Esfahbod 2018-11-13 19:49:06 -05:00 committed by GitHub
commit 2092f595c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 9 deletions

View File

@ -100,7 +100,7 @@ _hb_atomic_ptr_impl_cmplexch (const void **P, const void *O_, const void *N)
#define hb_atomic_ptr_impl_cmpexch(P,O,N) _hb_atomic_ptr_impl_cmplexch ((const void **) (P), (O), (N))
#elif !defined(HB_NO_MT) && (defined(_WIN32) || defined(__CYGWIN__))
#elif !defined(HB_NO_MT) && defined(_WIN32)
#include <windows.h>

View File

@ -481,7 +481,7 @@ hb_blob_t::try_make_writable (void)
# include <fcntl.h>
#endif
#if defined(_WIN32) || defined(__CYGWIN__)
#ifdef _WIN32
# include <windows.h>
#else
# ifndef O_BINARY
@ -497,19 +497,19 @@ struct hb_mapped_file_t
{
char *contents;
unsigned long length;
#if defined(_WIN32) || defined(__CYGWIN__)
#ifdef _WIN32
HANDLE mapping;
#endif
};
#if (defined(HAVE_MMAP) || defined(_WIN32) || defined(__CYGWIN__)) && !defined(HB_NO_MMAP)
#if (defined(HAVE_MMAP) || defined(_WIN32)) && !defined(HB_NO_MMAP)
static void
_hb_mapped_file_destroy (void *file_)
{
hb_mapped_file_t *file = (hb_mapped_file_t *) file_;
#ifdef HAVE_MMAP
munmap (file->contents, file->length);
#elif defined(_WIN32) || defined(__CYGWIN__)
#elif defined(_WIN32)
UnmapViewOfFile (file->contents);
CloseHandle (file->mapping);
#else
@ -560,7 +560,7 @@ fail:
fail_without_close:
free (file);
#elif (defined(_WIN32) || defined(__CYGWIN__)) && !defined(HB_NO_MMAP)
#elif defined(_WIN32) && !defined(HB_NO_MMAP)
hb_mapped_file_t *file = (hb_mapped_file_t *) calloc (1, sizeof (hb_mapped_file_t));
if (unlikely (!file)) return hb_blob_get_empty ();

View File

@ -48,7 +48,7 @@
/* Defined externally, i.e. in config.h; must have typedef'ed hb_mutex_impl_t as well. */
#elif !defined(HB_NO_MT) && (defined(_WIN32) || defined(__CYGWIN__))
#elif !defined(HB_NO_MT) && defined(_WIN32)
#include <windows.h>
typedef CRITICAL_SECTION hb_mutex_impl_t;

View File

@ -202,7 +202,7 @@ struct arabic_fallback_plan_t
OT::hb_ot_layout_lookup_accelerator_t accel_array[ARABIC_FALLBACK_MAX_LOOKUPS];
};
#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(HB_NO_WIN1256)
#if defined(_WIN32) && !defined(HB_NO_WIN1256)
#define HB_WITH_WIN1256
#endif

View File

@ -246,7 +246,7 @@ struct _hb_alignof
#endif
#if defined(_WIN32) || defined(__CYGWIN__)
#ifdef _WIN32
/* We need Windows Vista for both Uniscribe backend and for
* MemoryBarrier. We don't support compiling on Windows XP,
* though we run on it fine. */