public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
* Use of Win32 API in harfbuzz
@ 2018-07-12 16:25 Ken Brown
  2018-11-13 14:18 ` Ken Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Ken Brown @ 2018-07-12 16:25 UTC (permalink / raw)
  To: cygwin-apps

[-- Attachment #1: Type: text/plain, Size: 522 bytes --]

Yaakov,

A recent commit in upstream harfbuzz (ce17340) used the Win32 API on 
Cygwin.  I was about to send a patch upstream to fix this, but I thought 
I should first check for such uses in the current Cygwin release 
(1.7.6-1).  The attached patch removes the ones I found.

Am I right in removing all of these, or should some be kept?  I wasn't 
sure about the calls to setmode(), for example.

And is it OK with you for me to send Cygwin patches upstream, or would 
you rather be the one communicating with them?

Ken

[-- Attachment #2: harfbuzz-1.7.6-1.src.patch --]
[-- Type: text/plain, Size: 2509 bytes --]

--- origsrc/harfbuzz-1.7.6/src/hb-mutex-private.hh	2018-02-13 19:27:23.000000000 -0500
+++ src/harfbuzz-1.7.6/src/hb-mutex-private.hh	2018-07-12 09:20:15.256706400 -0400
@@ -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;
--- origsrc/harfbuzz-1.7.6/src/hb-ot-shape-complex-arabic-fallback.hh	2018-02-13 19:27:23.000000000 -0500
+++ src/harfbuzz-1.7.6/src/hb-ot-shape-complex-arabic-fallback.hh	2018-07-12 09:20:44.040285600 -0400
@@ -207,7 +207,7 @@ struct arabic_fallback_plan_t
 
 static const arabic_fallback_plan_t arabic_fallback_plan_nil = {};
 
-#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(HB_NO_WIN1256)
+#if defined(_WIN32) && !defined(HB_NO_WIN1256)
 #define HB_WITH_WIN1256
 #endif
 
--- origsrc/harfbuzz-1.7.6/src/hb-private.hh	2018-02-18 14:36:12.000000000 -0500
+++ src/harfbuzz-1.7.6/src/hb-private.hh	2018-07-12 09:21:34.168948600 -0400
@@ -177,7 +177,7 @@ extern "C" void  hb_free_impl(void *ptr)
 #  define HB_FALLTHROUGH /* FALLTHROUGH */
 #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. */
--- origsrc/harfbuzz-1.7.6/util/options.cc	2018-02-27 13:50:36.000000000 -0500
+++ src/harfbuzz-1.7.6/util/options.cc	2018-07-12 09:22:22.266873400 -0400
@@ -644,7 +644,7 @@ font_options_t::get_font (void) const
       /* read it */
       GString *gs = g_string_new (nullptr);
       char buf[BUFSIZ];
-#if defined(_WIN32) || defined(__CYGWIN__)
+#ifdef _WIN32
       setmode (fileno (stdin), O_BINARY);
 #endif
       while (!feof (stdin)) {
@@ -837,7 +837,7 @@ output_options_t::get_file_handle (void)
   if (output_file)
     fp = fopen (output_file, "wb");
   else {
-#if defined(_WIN32) || defined(__CYGWIN__)
+#ifdef _WIN32
     setmode (fileno (stdout), O_BINARY);
 #endif
     fp = stdout;
--- origsrc/harfbuzz-1.7.6/util/options.hh	2018-02-27 13:50:36.000000000 -0500
+++ src/harfbuzz-1.7.6/util/options.hh	2018-07-12 09:22:52.566393200 -0400
@@ -41,7 +41,7 @@
 #ifdef HAVE_UNISTD_H
 #include <unistd.h> /* for isatty() */
 #endif
-#if defined(_WIN32) || defined(__CYGWIN__)
+#ifdef _WIN32
 #include <io.h> /* for setmode() under Windows */
 #endif
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Use of Win32 API in harfbuzz
  2018-07-12 16:25 Use of Win32 API in harfbuzz Ken Brown
@ 2018-11-13 14:18 ` Ken Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Ken Brown @ 2018-11-13 14:18 UTC (permalink / raw)
  To: cygwin-apps

On 7/12/2018 12:24 PM, Ken Brown wrote:
> Yaakov,
> 
> A recent commit in upstream harfbuzz (ce17340) used the Win32 API on Cygwin.  I 
> was about to send a patch upstream to fix this, but I thought I should first 
> check for such uses in the current Cygwin release (1.7.6-1).  The attached patch 
> removes the ones I found.
> 
> Am I right in removing all of these, or should some be kept?  I wasn't sure 
> about the calls to setmode(), for example.
> 
> And is it OK with you for me to send Cygwin patches upstream, or would you 
> rather be the one communicating with them?

I never got a reply, so I went ahead and sent an updated version of the patch 
upstream:

   https://github.com/harfbuzz/harfbuzz/pull/1380

Yaakov, please comment there if you have a chance to take a look.

Ken

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-13 14:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-12 16:25 Use of Win32 API in harfbuzz Ken Brown
2018-11-13 14:18 ` Ken Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).