summaryrefslogtreecommitdiff
path: root/gcc/ada/gnatchop.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/gnatchop.adb')
-rw-r--r--gcc/ada/gnatchop.adb32
1 files changed, 24 insertions, 8 deletions
diff --git a/gcc/ada/gnatchop.adb b/gcc/ada/gnatchop.adb
index 0c5a25227af..a6b12e5c5fa 100644
--- a/gcc/ada/gnatchop.adb
+++ b/gcc/ada/gnatchop.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2004 Ada Core Technologies, Inc. --
+-- Copyright (C) 1998-2005 Ada Core Technologies, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -35,6 +35,8 @@ with GNAT.Table;
with Gnatvsn;
with Hostparm;
+with System.CRTL; use System.CRTL;
+
procedure Gnatchop is
Terminate_Program : exception;
@@ -182,7 +184,7 @@ procedure Gnatchop is
-- Note that this function returns false for the last entry.
procedure Sort_Units;
- -- Sort units and set up sorted unit table.
+ -- Sort units and set up sorted unit table
----------------------
-- File_Descriptors --
@@ -190,10 +192,6 @@ procedure Gnatchop is
function dup (handle : File_Descriptor) return File_Descriptor;
function dup2 (from, to : File_Descriptor) return File_Descriptor;
- -- File descriptor based functions needed for redirecting stdin/stdout
-
- pragma Import (C, dup, "dup");
- pragma Import (C, dup2, "dup2");
---------------------
-- Local variables --
@@ -332,6 +330,24 @@ procedure Gnatchop is
Success : out Boolean);
-- Write one compilation unit of the source to file
+ ---------
+ -- dup --
+ ---------
+
+ function dup (handle : File_Descriptor) return File_Descriptor is
+ begin
+ return File_Descriptor (System.CRTL.dup (int (handle)));
+ end dup;
+
+ ----------
+ -- dup2 --
+ ----------
+
+ function dup2 (from, to : File_Descriptor) return File_Descriptor is
+ begin
+ return File_Descriptor (System.CRTL.dup2 (int (from), int (to)));
+ end dup2;
+
---------------
-- Error_Msg --
---------------
@@ -1148,7 +1164,7 @@ procedure Gnatchop is
Put_Line (Standard_Error, Gnatvsn.Gnat_Version_String);
Put_Line
(Standard_Error,
- "Copyright 1998-2004, Ada Core Technologies Inc.");
+ "Copyright 1998-2005, Ada Core Technologies Inc.");
when 'w' =>
Overwrite_Files := True;
@@ -1316,7 +1332,7 @@ procedure Gnatchop is
Unit_Sort.Sort (Natural (Unit.Last));
- -- Set the Sorted_Index fields in the unit tables.
+ -- Set the Sorted_Index fields in the unit tables
for J in 1 .. SUnit_Num (Unit.Last) loop
Unit.Table (Sorted_Units.Table (J)).Sorted_Index := J;