Commit f5bb1134 by Thomas Quinot Committed by Arnaud Charlet

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
parent 11b9c936
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> 2009-09-14 Richard Henderson <rth@redhat.com>
* gcc-interface/trans.c (Pragma_to_gnu): Use build5 for ASM_EXPR. * gcc-interface/trans.c (Pragma_to_gnu): Use build5 for ASM_EXPR.
......
...@@ -31,8 +31,9 @@ ...@@ -31,8 +31,9 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
with System; use System; with System; use System;
with Ada.Calendar; use Ada.Calendar; with System.OS_Constants; use System.OS_Constants;
with Ada.Calendar; use Ada.Calendar;
with GNAT.IO; with GNAT.IO;
with GNAT.OS_Lib; use GNAT.OS_Lib; with GNAT.OS_Lib; use GNAT.OS_Lib;
...@@ -1195,15 +1196,14 @@ package body GNAT.Expect is ...@@ -1195,15 +1196,14 @@ package body GNAT.Expect is
pragma Warnings (Off, Pipe2); pragma Warnings (Off, Pipe2);
pragma Warnings (Off, Pipe3); 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; Input : File_Descriptor;
Output : File_Descriptor; Output : File_Descriptor;
Error : File_Descriptor; Error : File_Descriptor;
No_Fork_On_Target : constant Boolean := Target_OS = Windows;
begin begin
if On_Windows then if No_Fork_On_Target then
-- Since Windows does not have a separate fork/exec, we need to -- Since Windows does not have a separate fork/exec, we need to
-- perform the following actions: -- perform the following actions:
......
...@@ -175,6 +175,9 @@ int counter = 0; ...@@ -175,6 +175,9 @@ int counter = 0;
#endif #endif
#define STR(x) STR1(x)
#define STR1(x) #x
#ifdef __MINGW32__ #ifdef __MINGW32__
unsigned int _CRT_fmode = _O_BINARY; unsigned int _CRT_fmode = _O_BINARY;
#endif #endif
...@@ -218,6 +221,25 @@ package System.OS_Constants is ...@@ -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 -- -- System limits --
------------------- -------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment