From: Piotr Trojanek Date: Mon, 5 Sep 2022 09:40:50 +0000 (+0200) Subject: ada: Deconstruct build support for ancient MinGW X-Git-Tag: basepoints/gcc-14~4357 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=09b91bbcddd4900d433ea72f08dd11719bceaa58;p=thirdparty%2Fgcc.git ada: Deconstruct build support for ancient MinGW 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. --- diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c index 2ae4dedeb2b7..199dbe0e4052 100644 --- a/gcc/ada/adaint.c +++ b/gcc/ada/adaint.c @@ -200,11 +200,7 @@ UINT __gnat_current_ccs_encoding; #endif /* wait.h processing */ -#ifdef __MINGW32__ -# if OLD_MINGW -# include -# endif -#elif defined (__vxworks) && defined (__RTP__) +#if defined (__vxworks) && defined (__RTP__) # include #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 -#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 -#endif - #else #include #endif diff --git a/gcc/ada/cal.c b/gcc/ada/cal.c index e1ab6922b89b..09bcc15c4b37 100644 --- a/gcc/ada/cal.c +++ b/gcc/ada/cal.c @@ -53,10 +53,8 @@ #ifdef __MINGW32__ #include "mingw32.h" -#if STD_MINGW #include #endif -#endif void __gnat_timeval_to_duration (struct timeval *t, long long *sec, long *usec) diff --git a/gcc/ada/cstreams.c b/gcc/ada/cstreams.c index 10cc3a6faf89..fc583e17004b 100644 --- a/gcc/ada/cstreams.c +++ b/gcc/ada/cstreams.c @@ -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) { diff --git a/gcc/ada/expect.c b/gcc/ada/expect.c index b1889feff374..48fb1076e91e 100644 --- a/gcc/ada/expect.c +++ b/gcc/ada/expect.c @@ -42,17 +42,13 @@ #include "adaint.h" #include -#ifdef __MINGW32__ -# if OLD_MINGW -# include -# endif -#elif defined (__vxworks) && defined (__RTP__) +#if defined (__vxworks) && defined (__RTP__) # include #elif defined (__Lynx__) /* ??? See comment in adaint.c. */ # define GCC_RESOURCE_H # include -#elif defined (__PikeOS__) +#elif defined (__PikeOS__) || defined (__MINGW32__) /* No wait.h available */ #else #include diff --git a/gcc/ada/mingw32.h b/gcc/ada/mingw32.h index 1157fc680186..bf8577bb1d4f 100644 --- a/gcc/ada/mingw32.h +++ b/gcc/ada/mingw32.h @@ -101,23 +101,6 @@ extern UINT __gnat_current_ccs_encoding; #include -/* 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 diff --git a/gcc/ada/sysdep.c b/gcc/ada/sysdep.c index 5e9cf709082e..7bdfcbc047c6 100644 --- a/gcc/ada/sysdep.c +++ b/gcc/ada/sysdep.c @@ -323,11 +323,7 @@ __gnat_ttyname (int filedes ATTRIBUTE_UNUSED) || defined (__QNX__) # ifdef __MINGW32__ -# if OLD_MINGW -# include -# else -# include /* for getch(), kbhit() */ -# endif +# include /* for getch(), kbhit() */ # else # include # endif