From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id 4DE1B3858C83 for ; Mon, 26 Sep 2022 09:13:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4DE1B3858C83 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wm1-x333.google.com with SMTP id r133-20020a1c448b000000b003b494ffc00bso7096568wma.0 for ; Mon, 26 Sep 2022 02:13:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=2R6seQRZliQShVvJhZojfxwLMRi8IEfIcTAICBTV6Zw=; b=Wb5EqKNzFTgRwna+U7vPH9p7CJ1AkqeuLVUNAgvJZIQyiBD3Ao0H6a9zSLA1pKmaeM Si+ceBA8bXNyl+swdDFEz8XOXIcAZdmD8Ciaz+CaePcS3934nDjz+o1CyYCIuTn7fkIO xP42fYFWKpKetwDE/buQW87/1UoCj3lYX/kNiui4BqYNBxvfCt2PB+VHRgSNik08k4rQ SFJ4nUKhCGXPGBMl7H+vxyc7QoOxCzTQiMj4zSVA0NRTsKBpc7h6IIB4rqtgklA8S/DZ ie75SM8RC3wo/XWaVZ0pct52v4OSH74bRREznE2L1vtGzlxZLWojFSSB6R30JFaI3AAs oBvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=2R6seQRZliQShVvJhZojfxwLMRi8IEfIcTAICBTV6Zw=; b=S6lItk6xYzPQMyn72N8NrLuOM/TGFoDoCp7mD82LF0QWT18L0X/2/0d7/+6o50JPJ8 GgY5vnMvIuTEi+WiBCPqGB1EMHBtpt1hqFGHCQh95aH3W6j6aV75wY92+yIcsv7gc3f/ ExBpZxr37mxu8f0eRHUZXHJt7P28jC5RUbNd6IdCoJPQMROIToJvLvB+t0N+Ro3rWt0r /ICo+EK7AZrdMc9s5HP1IUmmVIM67oZqfH3G0X0mSGXG3yaBv87T/XkWVddlPjt3W4Rx KVIvMECfQHv+QadgDLKLfYgYsmAm/+sa0X6KiulPEMJfBvIx4WKrJxAtmXNJdETDiPdo Q+pg== X-Gm-Message-State: ACrzQf1PvvgbfPRs3ivRZGR6vw0oKP9ERQgPK/FZ4HC/AttHQ43thPVA rXbS2oLyYKP2UMBcQJcybew0NVpZvlEQeg== X-Google-Smtp-Source: AMsMyM6uy9/CrUDKq//yHJCkxuINUp7wGZ/P9KT9QRpNGeSjrjrsfLzOWRQTgBLEeiT9dj7Th8l7SQ== X-Received: by 2002:a7b:cc85:0:b0:3b4:9fc7:cd4d with SMTP id p5-20020a7bcc85000000b003b49fc7cd4dmr20637884wma.68.1664183610976; Mon, 26 Sep 2022 02:13:30 -0700 (PDT) Received: from localhost.localdomain (static-176-191-105-132.ftth.abo.bbox.fr. [176.191.105.132]) by smtp.gmail.com with ESMTPSA id bv4-20020a0560001f0400b00228d6bc8450sm15237026wrb.108.2022.09.26.02.13.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Sep 2022 02:13:30 -0700 (PDT) From: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITED] ada: Deconstruct build support for ancient MinGW Date: Mon, 26 Sep 2022 11:13:26 +0200 Message-Id: <20220926091326.272406-1-poulhies@adacore.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: From: Piotr Trojanek 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. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/adaint.c | 13 ++----------- gcc/ada/cal.c | 2 -- gcc/ada/cstreams.c | 8 -------- gcc/ada/expect.c | 8 ++------ gcc/ada/mingw32.h | 17 ----------------- gcc/ada/sysdep.c | 6 +----- 6 files changed, 5 insertions(+), 49 deletions(-) diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c index 2ae4dedeb2b..199dbe0e405 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 e1ab6922b89..09bcc15c4b3 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 10cc3a6faf8..fc583e17004 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 b1889feff37..48fb1076e91 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 1157fc68018..bf8577bb1d4 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 5e9cf709082..7bdfcbc047c 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 -- 2.25.1