From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 90786 invoked by alias); 30 Jul 2016 05:47:42 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 90773 invoked by uid 89); 30 Jul 2016 05:47:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=AWL,BAYES_05,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL autolearn=ham version=3.3.2 spammy=dir_separator, DIR_SEPARATOR, sk:file_na, sk:Current X-HELO: julia1.inet.fi Received: from mta-out1.inet.fi (HELO julia1.inet.fi) (62.71.2.231) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 30 Jul 2016 05:47:31 +0000 Received: from ap.localhost.localdomain (80.223.182.110) by julia1.inet.fi (9.0.002.03-2-gbe5d057) (authenticated as pavean-2) id 5782991C007A6A04; Sat, 30 Jul 2016 08:46:31 +0300 From: Andris Pavenis Subject: [PATCH 4/4][Ada,DJGPP] Ada support for DJGPP To: GCC Patches Cc: DJ Delorie Message-ID: Date: Sat, 30 Jul 2016 05:47:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------D270E6202896278EA2D56D84" X-SW-Source: 2016-07/txt/msg02008.txt.bz2 This is a multi-part message in MIME format. --------------D270E6202896278EA2D56D84 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 818 This last patch (4/4) contains DJGPP related changes to adaint.c (except one which belongs to patch 1/4). ChangeLog entry: 2016-07-30 Andris Pavenis * ada/adaint.c: Include process.h, signal.h, dir.h and utime.h for DJGPP. (DIR_SEPARATOR) define to '\\' for DJGPP. (__gnat_get_maximum_file_name_length): decide return value depending on availability of LFN for DJGPP (__gnat_get_file_names_case_sensitive): return 0 for DJGPP unless overriden in environment (__gnat_get_default_identifier_character_set): return '1' for DJGPP (__gnat_is_absolute_path): Support MS-DOS style absolute paths for DJGPP. (__gnat_portable_spawn): Use spewnvp for DJGPP. (__gnat_portable_no_block_spawn): Use spawnvp for DJGPP. (__gnat_portable_wait): Return 0 for DJGPP. Andris --------------D270E6202896278EA2D56D84 Content-Type: text/x-patch; name="0004-DJGPP-Ada-DJGPP-support.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0004-DJGPP-Ada-DJGPP-support.patch" Content-length: 3708 >From 3f96c997eb087c5ee4b90d706919074e36ee9927 Mon Sep 17 00:00:00 2001 From: Andris Pavenis Date: Mon, 25 Jul 2016 20:08:26 +0300 Subject: [PATCH 4/4] [DJGPP, Ada] DJGPP support * ada/adaint.c: Include process.h, signal.h, dir.h and utime.h for DJGPP. (DIR_SEPARATOR) define to '\\' for DJGPP. (__gnat_get_maximum_file_name_length): decide return value depending on availability of LFN for DJGPP (__gnat_get_file_names_case_sensitive): return 0 for DJGPP unless overriden in environment (__gnat_get_default_identifier_character_set): return '1' for DJGPP (__gnat_is_absolute_path): Support MS-DOS style absolute paths for DJGPP. (__gnat_portable_spawn): Use spewnvp for DJGPP. (__gnat_portable_no_block_spawn): Use spawnvp for DJGPP. (__gnat_portable_wait): Return 0 for DJGPP. Signed-off-by: Andris Pavenis --- gcc/ada/adaint.c | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c index f317865..1658acf 100644 --- a/gcc/ada/adaint.c +++ b/gcc/ada/adaint.c @@ -165,11 +165,16 @@ UINT CurrentCCSEncoding; #include #endif -#if defined (_WIN32) - +#if defined (__DJGPP__) #include #include #include +#include +#undef DIR_SEPARATOR +#define DIR_SEPARATOR '\\' + +#elif defined (_WIN32) + #include #include #include @@ -538,7 +543,11 @@ __gnat_try_lock (char *dir, char *file) int __gnat_get_maximum_file_name_length (void) { +#if defined (__DJGPP__) + return (_use_lfn(".")) ? -1 : 8; +#else return -1; +#endif } /* Return nonzero if file names are case sensitive. */ @@ -560,7 +569,7 @@ __gnat_get_file_names_case_sensitive (void) { /* By default, we suppose filesystems aren't case sensitive on Windows and Darwin (but they are on arm-darwin). */ -#if defined (WINNT) \ +#if defined (WINNT) || defined (__DJGPP__) \ || (defined (__APPLE__) && !(defined (__arm__) || defined (__arm64__))) file_names_case_sensitive_cache = 0; #else @@ -576,7 +585,7 @@ __gnat_get_file_names_case_sensitive (void) int __gnat_get_env_vars_case_sensitive (void) { -#if defined (WINNT) +#if defined (WINNT) || defined (__DJGPP__) return 0; #else return 1; @@ -586,7 +595,11 @@ __gnat_get_env_vars_case_sensitive (void) char __gnat_get_default_identifier_character_set (void) { +#if defined (__DJGPP__) + return 'p'; +#else return '1'; +#endif } /* Return the current working directory. */ @@ -1646,7 +1659,7 @@ __gnat_is_absolute_path (char *name, int length) #else return (length != 0) && (*name == '/' || *name == DIR_SEPARATOR -#if defined (WINNT) +#if defined (WINNT) || defined(__DJGPP__) || (length > 1 && ISALPHA (name[0]) && name[1] == ':') #endif ); @@ -2234,7 +2247,7 @@ __gnat_portable_spawn (char *args[] ATTRIBUTE_UNUSED) #if defined (__vxworks) || defined(__PikeOS__) return -1; -#elif defined (_WIN32) +#elif defined (__DJGPP__) || defined (_WIN32) /* args[0] must be quotes as it could contain a full pathname with spaces */ char *args_0 = args[0]; args[0] = (char *)xmalloc (strlen (args_0) + 3); @@ -2606,6 +2619,12 @@ __gnat_portable_no_block_spawn (char *args[] ATTRIBUTE_UNUSED) /* Not supported. */ return -1; +#elif defined(__DJGPP__) + if (spawnvp (P_WAIT, args[0], args) != 0) + return -1; + else + return 0; + #elif defined (_WIN32) HANDLE h = NULL; @@ -2649,6 +2668,7 @@ __gnat_portable_wait (int *process_status) pid = win32_wait (&status); +#elif defined (__DJGPP__) #else pid = waitpid (-1, &status, 0); -- 2.7.4 --------------D270E6202896278EA2D56D84--