+2013-01-29 Ben Brosgol <brosgol@adacore.com>
+
+ * gnat_rm.texi: Fixed typos. Minor edits.
+
+2013-01-29 Bob Duff <duff@adacore.com>
+
+ * a-convec.adb: Minor reformatting.
+
+2013-01-29 Pascal Obry <obry@adacore.com>
+
+ * tempdir.adb, tempdir.ads (Use_Temp_Dir): Set wether to use the temp
+ directory.
+
2013-01-29 Ed Schonberg <schonberg@adacore.com>
* exp_ch5.adb (Expand_Iterator_Loop_Over_Array): Preserve loop
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, 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- --
C := Capacity;
else
- raise Capacity_Error
- with "Requested capacity is less than Source length";
+ raise Capacity_Error with
+ "Requested capacity is less than Source length";
end if;
return Target : Vector do
This is an Ada 2012 representation pragma which applies to protected, task
and synchronized interface primitives. The use of pragma Implemented provides
a way to impose a static requirement on the overriding operation by adhering
-to one of the three implementation kids: entry, protected procedure or any of
+to one of the three implementation kinds: entry, protected procedure or any of
the above. This pragma is available in all earlier versions of Ada as an
implementation-defined pragma.
pragma in all earlier versions. It specifies that the
designated object or all objects of the designated type must be
independently addressable. This means that separate tasks can safely
-manipulate such objects. For example, if two comonents of a record are
+manipulate such objects. For example, if two components of a record are
independent, then two separate tasks may access these two components.
This may place
constraints on the representation of the object (for instance prohibiting
This pragma is standard in Ada 2012 mode (which also provides an aspect
of the same name). It is also available as an implementation-defined
pragma in all earlier versions. It specifies that the components of the
-designated object or all objects of the designated type must be
+designated object, or the components of each object of the designated
+type, must be
independently addressable. This means that separate tasks can safely
-manipulate separate components in the composite object. this may place
+manipulate separate components in the composite object. This may place
constraints on the representation of the object (for instance prohibiting
tight packing).
-- --
-- B o d y --
-- --
--- Copyright (C) 2003-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2003-2013, Free Software Foundation, 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- --
Tmpdir : constant String := "TMPDIR";
Gnutmpdir : constant String := "GNUTMPDIR";
- No_Dir : aliased String := "";
- Temp_Dir : String_Access := No_Dir'Access;
+ Temp_Dir : String_Access := new String'("");
----------------------
-- Create_Temp_File --
(FD : out File_Descriptor;
Name : out Path_Name_Type)
is
- File_Name : String_Access;
+ File_Name : String_Access;
Current_Dir : constant String := Get_Current_Dir;
function Directory return String;
begin
if Temp_Dir'Length /= 0 then
return Temp_Dir.all;
-
else
return Current_Dir;
end if;
Path_Name : constant String :=
Normalize_Pathname
(Directory & Directory_Separator & File_Name.all);
-
begin
Name_Len := Path_Name'Length;
Name_Buffer (1 .. Name_Len) := Path_Name;
end if;
end Create_Temp_File;
--- Start of elaboration for package Tempdir
+ ------------------
+ -- Use_Temp_Dir --
+ ------------------
-begin
- declare
+ procedure Use_Temp_Dir (Status : Boolean) is
Dir : String_Access;
begin
- -- On VMS, if GNUTMPDIR is defined, use it
+ if Status then
- if OpenVMS then
- Dir := Getenv (Gnutmpdir);
+ -- On VMS, if GNUTMPDIR is defined, use it
- -- Otherwise, if GNUTMPDIR is not defined, try TMPDIR
+ if OpenVMS then
+ Dir := Getenv (Gnutmpdir);
- if Dir'Length = 0 then
+ -- Otherwise, if GNUTMPDIR is not defined, try TMPDIR
+
+ if Dir'Length = 0 then
+ Dir := Getenv (Tmpdir);
+ end if;
+
+ else
Dir := Getenv (Tmpdir);
end if;
-
- else
- Dir := Getenv (Tmpdir);
end if;
- if Dir'Length > 0 and then
- Is_Absolute_Path (Dir.all) and then
- Is_Directory (Dir.all)
+ Free (Temp_Dir);
+
+ if Dir /= null
+ and then Dir'Length > 0
+ and then Is_Absolute_Path (Dir.all)
+ and then Is_Directory (Dir.all)
then
Temp_Dir := new String'(Normalize_Pathname (Dir.all));
+ else
+ Temp_Dir := new String'("");
end if;
Free (Dir);
- end;
+ end Use_Temp_Dir;
+
+-- Start of elaboration for package Tempdir
+
+begin
+ Use_Temp_Dir (Status => True);
end Tempdir;
-- --
-- S p e c --
-- --
--- Copyright (C) 2003-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 2003-2013, Free Software Foundation, 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- --
-- directory. If temporary file cannot be created, FD gets the value
-- Invalid_FD and Name gets the value No_Name.
+ procedure Use_Temp_Dir (Status : Boolean);
+ -- Specify if the temp file should be created in the system temporary
+ -- directory as specified by the corresponding environment variables. If
+ -- Status is False, the temp files will be created into the current working
+ -- directory.
+
end Tempdir;