From eee5b5ed04f588f618a2251397dd5b850c378627 Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Mon, 12 Nov 2018 21:05:39 -0500 Subject: [PATCH] Don't use Win32 API on Cygwin Cygwin is a Posix platform to the extent possible. It should use the Posix API except in special circumstances. --- src/hb-atomic.hh | 2 +- src/hb-blob.cc | 10 +++++----- src/hb-mutex.hh | 2 +- src/hb-ot-shape-complex-arabic-fallback.hh | 2 +- src/hb.hh | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/hb-atomic.hh b/src/hb-atomic.hh index 49c2809e2..1f500d71d 100644 --- a/src/hb-atomic.hh +++ b/src/hb-atomic.hh @@ -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 diff --git a/src/hb-blob.cc b/src/hb-blob.cc index 26c0d143e..8ebedca78 100644 --- a/src/hb-blob.cc +++ b/src/hb-blob.cc @@ -481,7 +481,7 @@ hb_blob_t::try_make_writable (void) # include #endif -#if defined(_WIN32) || defined(__CYGWIN__) +#ifdef _WIN32 # include #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 (); diff --git a/src/hb-mutex.hh b/src/hb-mutex.hh index 75b89addb..b529091d4 100644 --- a/src/hb-mutex.hh +++ b/src/hb-mutex.hh @@ -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 typedef CRITICAL_SECTION hb_mutex_impl_t; diff --git a/src/hb-ot-shape-complex-arabic-fallback.hh b/src/hb-ot-shape-complex-arabic-fallback.hh index 0fb3793e2..5be6f8d69 100644 --- a/src/hb-ot-shape-complex-arabic-fallback.hh +++ b/src/hb-ot-shape-complex-arabic-fallback.hh @@ -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 diff --git a/src/hb.hh b/src/hb.hh index e3faf17c9..16ccf87ce 100644 --- a/src/hb.hh +++ b/src/hb.hh @@ -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. */