diff mbox series

Fix PR ada/82393

Message ID 1951967.6gvYFoEp07@polaris
State New
Headers show
Series Fix PR ada/82393 | expand

Commit Message

Eric Botcazou Oct. 5, 2017, 4:32 p.m. UTC
It's a build failure on Cygwin64 and is very similar to PR ada/64640, which 
was a build failure on Cygwin32.  Instead of defining non-existent constants, 
let's just reuse the DJGPP version of __gnat_set_mode here.

Applied on the mainline and 7 branch.


2017-10-05  Eric Botcazou  <ebotcazou@adacore.com>

	PR ada/82393
	* mingw32.h (_O_U8TEXT, _O_U16TEXT, _O_WTEXT): Delete.
	* sysdep.c (__gnat_set_mode ): Use DJGPP version for Cygwin.
diff mbox series

Patch

Index: mingw32.h
===================================================================
--- mingw32.h	(revision 253398)
+++ mingw32.h	(working copy)
@@ -59,16 +59,6 @@ 
 #endif
 #include <windows.h>
 
-#ifndef _O_U8TEXT
-#define _O_U8TEXT _O_TEXT
-#endif
-#ifndef _O_U16TEXT
-#define _O_U16TEXT _O_TEXT
-#endif
-#ifndef _O_WTEXT
-#define _O_WTEXT _O_TEXT
-#endif
-
 /* After including this file it is possible to use the character t as prefix
    to routines. If GNAT_UNICODE_SUPPORT is defined then the unicode enabled
    versions will be used.  */
Index: sysdep.c
===================================================================
--- sysdep.c	(revision 253398)
+++ sysdep.c	(working copy)
@@ -126,7 +126,7 @@  extern struct tm *localtime_r(const time
 
 */
 
-#if defined (WINNT) || defined (__CYGWIN__) || defined(__DJGPP__)
+#if defined (WINNT) || defined (__CYGWIN__) || defined (__DJGPP__)
 
 const char __gnat_text_translation_required = 1;
 
@@ -137,7 +137,7 @@  const char __gnat_text_translation_requi
 #define WIN_SETMODE _setmode
 #endif
 
-#if defined(__DJGPP__)
+#if defined (__DJGPP__)
 #include <io.h>
 #define _setmode setmode
 #endif /* __DJGPP__ */
@@ -154,7 +154,7 @@  __gnat_set_text_mode (int handle)
   WIN_SETMODE (handle, O_TEXT);
 }
 
-#ifdef __DJGPP__
+#if defined (__CYGWIN__) || defined (__DJGPP__)
 void
 __gnat_set_mode (int handle, int mode)
 {
@@ -826,7 +826,7 @@  __gnat_localtime_tzoff (const time_t *ti
 
 #elif defined (__APPLE__) || defined (__FreeBSD__) || defined (__linux__) \
   || defined (__GLIBC__) || defined (__DragonFly__) || defined (__OpenBSD__) \
-  || defined(__DJGPP__)
+  || defined (__DJGPP__)
 {
   localtime_r (timer, &tp);
   *off = tp.tm_gmtoff;