aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorThomas Quinot <quinot@adacore.com>2009-09-16 12:21:10 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2009-09-16 14:21:10 +0200
commitf5bb1134c9e0974a05ed7533c82efa3861cff27c (patch)
tree29fdbdfcbf397675f40f0b6f3e25fe8e9f03d2a2 /gcc/ada
parent11b9c936bf663357c37c213a285ad44d5e530264 (diff)
downloadgcc-f5bb1134c9e0974a05ed7533c82efa3861cff27c.zip
gcc-f5bb1134c9e0974a05ed7533c82efa3861cff27c.tar.gz
gcc-f5bb1134c9e0974a05ed7533c82efa3861cff27c.tar.bz2
s-oscons-tmplt.c (Target_OS, [...]): New constants.
2009-09-16 Thomas Quinot <quinot@adacore.com> * s-oscons-tmplt.c (Target_OS, Target_Name): New constants. * g-expect.adb (Set_Up_Child_Communications): Use System.OS_Constants.Target_OS to determine whether running on Windows. From-SVN: r151747
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/g-expect.adb12
-rw-r--r--gcc/ada/s-oscons-tmplt.c22
3 files changed, 34 insertions, 6 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index cb38dab..6c975b4 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,9 @@
+2009-09-16 Thomas Quinot <quinot@adacore.com>
+
+ * s-oscons-tmplt.c (Target_OS, Target_Name): New constants.
+ * g-expect.adb (Set_Up_Child_Communications): Use
+ System.OS_Constants.Target_OS to determine whether running on Windows.
+
2009-09-14 Richard Henderson <rth@redhat.com>
* gcc-interface/trans.c (Pragma_to_gnu): Use build5 for ASM_EXPR.
diff --git a/gcc/ada/g-expect.adb b/gcc/ada/g-expect.adb
index 02bc6cf..a67696a 100644
--- a/gcc/ada/g-expect.adb
+++ b/gcc/ada/g-expect.adb
@@ -31,8 +31,9 @@
-- --
------------------------------------------------------------------------------
-with System; use System;
-with Ada.Calendar; use Ada.Calendar;
+with System; use System;
+with System.OS_Constants; use System.OS_Constants;
+with Ada.Calendar; use Ada.Calendar;
with GNAT.IO;
with GNAT.OS_Lib; use GNAT.OS_Lib;
@@ -1195,15 +1196,14 @@ package body GNAT.Expect is
pragma Warnings (Off, Pipe2);
pragma Warnings (Off, Pipe3);
- On_Windows : constant Boolean := Directory_Separator = '\';
- -- This is ugly, we need a better way of doing this test ???
-
Input : File_Descriptor;
Output : File_Descriptor;
Error : File_Descriptor;
+ No_Fork_On_Target : constant Boolean := Target_OS = Windows;
+
begin
- if On_Windows then
+ if No_Fork_On_Target then
-- Since Windows does not have a separate fork/exec, we need to
-- perform the following actions:
diff --git a/gcc/ada/s-oscons-tmplt.c b/gcc/ada/s-oscons-tmplt.c
index c4218c2..a2ae16e 100644
--- a/gcc/ada/s-oscons-tmplt.c
+++ b/gcc/ada/s-oscons-tmplt.c
@@ -175,6 +175,9 @@ int counter = 0;
#endif
+#define STR(x) STR1(x)
+#define STR1(x) #x
+
#ifdef __MINGW32__
unsigned int _CRT_fmode = _O_BINARY;
#endif
@@ -218,6 +221,25 @@ package System.OS_Constants is
/*
+ -----------------------------
+ -- Platform identification --
+ -----------------------------
+
+*/
+TXT(" Target_Name : constant String := " STR(TARGET) ";")
+/*
+ type Target_OS_Type is (Windows, VMS, Other_OS);
+*/
+#if defined (__MINGW32__)
+# define TARGET_OS Windows
+#elif defined (__VMS)
+# define TARGET_OS VMS
+#else
+# define TARGET_OS Other_OS
+#endif
+TXT(" Target_OS : constant Target_OS_Type := " STR(TARGET_OS) ";")
+/*
+
-------------------
-- System limits --
-------------------