public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: JonY <10walls@gmail.com>
To: Gcc Patch List <gcc-patches@gcc.gnu.org>
Subject: [Patch] Disable text mode translation in ada for Cygwin
Date: Thu, 26 May 2016 14:39:00 -0000	[thread overview]
Message-ID: <5746EDDC.30309@gmail.com> (raw)

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

Text mode translation should not be done for Cygwin, especially since it does not
support unicode setmode calls. This also fixes ada builds for Cygwin.

OK for trunk?

gcc/ada/ChangeLog:
	* sysdep.c (__gnat_set_binary_mode, __gnat_set_text_mode,
	__gnat_set_mode): Disable text mode translation, Cygwin should
	follow *Nix behavior. This also fixes build failures on Cywgin.

diff --git a/gcc/ada/sysdep.c b/gcc/ada/sysdep.c
index 465007e..aeaed6d 100644
--- a/gcc/ada/sysdep.c
+++ b/gcc/ada/sysdep.c
@@ -128,15 +128,15 @@ extern struct tm *localtime_r(const time_t *, struct tm *);

 #if defined (WINNT) || defined (__CYGWIN__)

+#if defined (__CYGWIN__)
+const char __gnat_text_translation_required = 0;
+void __gnat_set_binary_mode (int handle) {}
+void __gnat_set_text_mode (int handle) {}
+void __gnat_set_mode(int handle, int mode) {}
+#else
 const char __gnat_text_translation_required = 1;

-#ifdef __CYGWIN__
-#define WIN_SETMODE setmode
-#include <io.h>
-#else
 #define WIN_SETMODE _setmode
-#endif
-
 void
 __gnat_set_binary_mode (int handle)
 {
@@ -172,6 +172,8 @@ __gnat_set_mode (int handle, int mode)
  }
 }

+#endif __CYGWIN__
+
 #ifdef __CYGWIN__

 char *


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

             reply	other threads:[~2016-05-26 12:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-26 14:39 JonY [this message]
2016-05-26 14:43 ` Arnaud Charlet
2016-05-27  9:09   ` JonY
2016-06-01 10:28     ` JonY
2016-07-01 11:57       ` JonY
2016-07-01 12:00         ` Arnaud Charlet
2016-07-01 12:33           ` JonY
2016-08-19 11:52 ` JonY
2016-08-19 12:49   ` Arnaud Charlet
2016-08-19 23:02     ` JonY
2016-08-25  9:11       ` Arnaud Charlet
2016-08-21 18:44     ` Gerald Pfeifer

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=5746EDDC.30309@gmail.com \
    --to=10walls@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    /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).