]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Deconstruct build support for ancient MinGW
authorPiotr Trojanek <trojanek@adacore.com>
Mon, 5 Sep 2022 09:40:50 +0000 (11:40 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 26 Sep 2022 09:02:29 +0000 (11:02 +0200)
Remove conditional C code for building GNAT with MinGW earlier than 2.0,
which was released in 2007.

gcc/ada/

* adaint.c: Remove conditional #include directives for old MinGW.
* cal.c: Always include winsock.h, since it is part of modern
MinGW.
* cstreams.c: Remove workaround for old MinGW.
* expect.c: Remove conditional #include directive for old MinGW.
* mingw32.h: Remove STD_MINGW and OLD_MINGW declarations.
* sysdep.c: Remove conditional #include directive for old MinGW.

gcc/ada/adaint.c
gcc/ada/cal.c
gcc/ada/cstreams.c
gcc/ada/expect.c
gcc/ada/mingw32.h
gcc/ada/sysdep.c

index 2ae4dedeb2b73dd7f2d4cb464f2ea2113f4006c5..199dbe0e4052671aa53b38ac6d953a3829588667 100644 (file)
@@ -200,11 +200,7 @@ UINT __gnat_current_ccs_encoding;
 #endif
 
 /* wait.h processing */
-#ifdef __MINGW32__
-# if OLD_MINGW
-#  include <sys/wait.h>
-# endif
-#elif defined (__vxworks) && defined (__RTP__)
+#if defined (__vxworks) && defined (__RTP__)
 # include <wait.h>
 #elif defined (__Lynx__)
 /* ??? We really need wait.h and it includes resource.h on Lynx.  GCC
@@ -214,7 +210,7 @@ UINT __gnat_current_ccs_encoding;
    preventing the inclusion of the GCC header from doing anything.  */
 # define GCC_RESOURCE_H
 # include <sys/wait.h>
-#elif defined (__PikeOS__)
+#elif defined (__PikeOS__) || defined (__MINGW32__)
 /* No wait() or waitpid() calls available.  */
 #else
 /* Default case.  */
@@ -335,11 +331,6 @@ const char *__gnat_library_template = GNAT_LIBRARY_TEMPLATE;
 
 #if defined (__MINGW32__)
 #include "mingw32.h"
-
-#if OLD_MINGW
-#include <sys/param.h>
-#endif
-
 #else
 #include <sys/param.h>
 #endif
index e1ab6922b89b588c9f90c7f00f230e4a1383f9ae..09bcc15c4b37ed868ddb465541bb4a8613f8999f 100644 (file)
 
 #ifdef __MINGW32__
 #include "mingw32.h"
-#if STD_MINGW
 #include <winsock.h>
 #endif
-#endif
 
 void
 __gnat_timeval_to_duration (struct timeval *t, long long *sec, long *usec)
index 10cc3a6faf894b228670497cd30c939de3078ad3..fc583e17004be3a419d619c6821d229a886db00e 100644 (file)
@@ -97,14 +97,6 @@ extern "C" {
 #undef fileno
 #endif
 
-/* The _IONBF value in MINGW32 stdio.h is wrong.  */
-#if defined (WINNT) || defined (_WINNT)
-#if OLD_MINGW
-#undef _IONBF
-#define _IONBF 0004
-#endif
-#endif
-
 int
 __gnat_feof (FILE *stream)
 {
index b1889feff374c03a11b9ce17ce9043a9f6b5d0b0..48fb1076e91e11fcb2e1ebdc411f54dae8e406e6 100644 (file)
 #include "adaint.h"
 #include <sys/types.h>
 
-#ifdef __MINGW32__
-# if OLD_MINGW
-#  include <sys/wait.h>
-# endif
-#elif defined (__vxworks) && defined (__RTP__)
+#if defined (__vxworks) && defined (__RTP__)
 # include <wait.h>
 #elif defined (__Lynx__)
   /* ??? See comment in adaint.c.  */
 # define GCC_RESOURCE_H
 # include <sys/wait.h>
-#elif defined (__PikeOS__)
+#elif defined (__PikeOS__) || defined (__MINGW32__)
   /* No wait.h available */
 #else
 #include <sys/wait.h>
index 1157fc6801864af55d884a2e279777f06f54bad4..bf8577bb1d4f9e95af4ae72014cfd65125f1d21f 100644 (file)
@@ -101,23 +101,6 @@ extern UINT __gnat_current_ccs_encoding;
 
 #include <stdlib.h>
 
-/* STD_MINGW: standard if MINGW32 version > 1.3, we have switched to this
-   version instead of the previous enhanced version to ease building GNAT on
-   Windows platforms. By using STD_MINGW or OLD_MINGW it is possible to build
-   GNAT using both MingW include files (Old MingW + ACT changes and standard
-   MingW starting with version 1.3.
-   For w64 Mingw the define STD_MINGW is always set to value 1, because
-   there is no old header set present.  */
-#ifdef _WIN64
-#define STD_MINGW 1
-#else
-#define STD_MINGW ((__MINGW32_MAJOR_VERSION == 1 \
-                  && __MINGW32_MINOR_VERSION >= 3) \
-     || (__MINGW32_MAJOR_VERSION >= 2))
-#endif
-
-#define OLD_MINGW (!(STD_MINGW))
-
 #ifndef MAXPATHLEN
 #define MAXPATHLEN MAX_PATH
 #endif
index 5e9cf709082e9bc7790fa1af11fd3d18c70ea9d7..7bdfcbc047c623ee13c20385cc8494254b35ecaa 100644 (file)
@@ -323,11 +323,7 @@ __gnat_ttyname (int filedes ATTRIBUTE_UNUSED)
   || defined (__QNX__)
 
 # ifdef __MINGW32__
-#  if OLD_MINGW
-#   include <termios.h>
-#  else
-#   include <conio.h>  /* for getch(), kbhit() */
-#  endif
+#  include <conio.h>  /* for getch(), kbhit() */
 # else
 #  include <termios.h>
 # endif