public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: Ken Brown <kbrown@cornell.edu>
To: cygwin-apps <cygwin-apps@cygwin.com>
Subject: Use of Win32 API in harfbuzz
Date: Thu, 12 Jul 2018 16:25:00 -0000	[thread overview]
Message-ID: <22165fae-2b9c-c872-e920-6d0983786c9e@cornell.edu> (raw)

[-- 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
 

             reply	other threads:[~2018-07-12 16:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-12 16:25 Ken Brown [this message]
2018-11-13 14:18 ` Ken Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=22165fae-2b9c-c872-e920-6d0983786c9e@cornell.edu \
    --to=kbrown@cornell.edu \
    --cc=cygwin-apps@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).