Commit 3568b271 by Arnaud Charlet

[multiple changes]

2009-04-20  Thomas Quinot  <quinot@adacore.com>

	* g-socket.ads: Add new constants:
	  Loopback_Inet_Addr
	  Unspecified_Group_Inet_Addr
	  All_Hosts_Group_Inet_Addr
	  All_Routers_Group_Inet_Addr

	* s-oscons-tmplt.c, g-sttsne-vxworks.adb (System.OS_Constants): Add
	ERANGE (Result too large).
	(GNAT.Sockets.Thin.Task_Safe_NetDB, VxWorks version): Add missing
	propagation of errno to caller.

2009-04-20  Hristian Kirtchev  <kirtchev@adacore.com>

	* a-calend.adb, a-calend-vms.adb: Increase the number of leap seconds
	to 24. Increment Leap_Seconds_Count and add an entry to aggregate
	Leap_Second_Times.

2009-04-20  Vincent Celier  <celier@adacore.com>

	* mlib-prj.adb (Build_Library): Use the shared library linker, if one
	has been declared (Library_GCC or Linker'Driver), for the driver name.

	* prj-nmsc.adb (Process_Linker): If Library_GCC is not declared and
	Linker'Driver is, use Linker'Driver as the shared library linker.
	(Process_Project_Level_Simple_Attributes): Issue a warning if attribute
	Library_GCC is declared.
	(Check_Library_Attributes): Set up the shared linker driver: either
	Library_GCC or Linker'Driver. Issue a warning if Library_GCC is
	declared.

From-SVN: r146386
parent 16212e89
2009-04-20 Thomas Quinot <quinot@adacore.com> 2009-04-20 Thomas Quinot <quinot@adacore.com>
* g-socket.ads: Add new constants:
Loopback_Inet_Addr
Unspecified_Group_Inet_Addr
All_Hosts_Group_Inet_Addr
All_Routers_Group_Inet_Addr
* s-oscons-tmplt.c, g-sttsne-vxworks.adb (System.OS_Constants): Add
ERANGE (Result too large).
(GNAT.Sockets.Thin.Task_Safe_NetDB, VxWorks version): Add missing
propagation of errno to caller.
2009-04-20 Hristian Kirtchev <kirtchev@adacore.com>
* a-calend.adb, a-calend-vms.adb: Increase the number of leap seconds
to 24. Increment Leap_Seconds_Count and add an entry to aggregate
Leap_Second_Times.
2009-04-20 Gary Dismukes <dismukes@adacore.com>
* sem_elim.ads (Check_For_Eliminated_Subprogram): New procedure for
checking for references to eliminated subprograms that should be
flagged.
(Eliminate_Error_Message): Update comment to say "references" rather
than "calls" (since attribute cases are handled here as well).
* sem_elim.adb (Check_For_Eliminated_Subprogram): New procedure for
checking for references to eliminated subprograms that should be
flagged. Add with and use of Sem and Sem_Util.
* sem_res.adb (Resolve_Call): Reject calls to eliminated subprograms.
Add with and use of Sem_Elim.
* sem_attr.adb (Analyze_Access_Attribute): Reject access attributes
applied to eliminated subprograms.
(Analyze_Attribute): Reject 'Address and 'Code_Address applied to
eliminated subprograms.
Add with and use of Sem_Elim.
* sem_disp.adb (Check_Dispatching_Call): Remove error check for calls
to eliminated subprograms, now handled during Resolve_Call.
Remove with and use of Sem_Elim.
* exp_disp.adb (Make_DT): Get Ultimate_Alias of primitive before
testing Is_Eliminated, for proper handling of primitive derived from
eliminated subprograms.
2009-04-20 Vincent Celier <celier@adacore.com>
* mlib-prj.adb (Build_Library): Use the shared library linker, if one
has been declared (Library_GCC or Linker'Driver), for the driver name.
* prj-nmsc.adb (Process_Linker): If Library_GCC is not declared and
Linker'Driver is, use Linker'Driver as the shared library linker.
(Process_Project_Level_Simple_Attributes): Issue a warning if attribute
Library_GCC is declared.
(Check_Library_Attributes): Set up the shared linker driver: either
Library_GCC or Linker'Driver. Issue a warning if Library_GCC is
declared.
2009-04-20 Thomas Quinot <quinot@adacore.com>
* g-socket.ads (Send_Socket): Fix misleading comment. * g-socket.ads (Send_Socket): Fix misleading comment.
2009-04-20 Arnaud Charlet <charlet@adacore.com> 2009-04-20 Arnaud Charlet <charlet@adacore.com>
...@@ -126,7 +126,7 @@ package body Ada.Calendar is ...@@ -126,7 +126,7 @@ package body Ada.Calendar is
-- The above flag controls the usage of leap seconds in all Ada.Calendar -- The above flag controls the usage of leap seconds in all Ada.Calendar
-- routines. -- routines.
Leap_Seconds_Count : constant Natural := 23; Leap_Seconds_Count : constant Natural := 24;
--------------------- ---------------------
-- Local Constants -- -- Local Constants --
...@@ -176,7 +176,8 @@ package body Ada.Calendar is ...@@ -176,7 +176,8 @@ package body Ada.Calendar is
43271712190000000, 43271712190000000,
43744320200000000, 43744320200000000,
44218656210000000, 44218656210000000,
46427904220000000); 46427904220000000,
47374848230000000);
--------- ---------
-- "+" -- -- "+" --
......
...@@ -139,7 +139,7 @@ package body Ada.Calendar is ...@@ -139,7 +139,7 @@ package body Ada.Calendar is
-- The above flag controls the usage of leap seconds in all Ada.Calendar -- The above flag controls the usage of leap seconds in all Ada.Calendar
-- routines. -- routines.
Leap_Seconds_Count : constant Natural := 23; Leap_Seconds_Count : constant Natural := 24;
--------------------- ---------------------
-- Local Constants -- -- Local Constants --
...@@ -212,7 +212,8 @@ package body Ada.Calendar is ...@@ -212,7 +212,8 @@ package body Ada.Calendar is
-4859827181000000000, -4859827181000000000,
-4812566380000000000, -4812566380000000000,
-4765132779000000000, -4765132779000000000,
-4544207978000000000); -4544207978000000000,
-4449513577000000000);
--------- ---------
-- "+" -- -- "+" --
......
...@@ -491,6 +491,13 @@ package GNAT.Sockets is ...@@ -491,6 +491,13 @@ package GNAT.Sockets is
Any_Inet_Addr : constant Inet_Addr_Type; Any_Inet_Addr : constant Inet_Addr_Type;
No_Inet_Addr : constant Inet_Addr_Type; No_Inet_Addr : constant Inet_Addr_Type;
Broadcast_Inet_Addr : constant Inet_Addr_Type; Broadcast_Inet_Addr : constant Inet_Addr_Type;
Loopback_Inet_Addr : constant Inet_Addr_Type;
-- Useful constants for IPv4 multicast addresses
Unspecified_Group_Inet_Addr : constant Inet_Addr_Type;
All_Hosts_Group_Inet_Addr : constant Inet_Addr_Type;
All_Routers_Group_Inet_Addr : constant Inet_Addr_Type;
type Sock_Addr_Type (Family : Family_Type := Family_Inet) is record type Sock_Addr_Type (Family : Family_Type := Family_Inet) is record
Addr : Inet_Addr_Type (Family); Addr : Inet_Addr_Type (Family);
...@@ -1155,6 +1162,15 @@ private ...@@ -1155,6 +1162,15 @@ private
(Family_Inet, (others => 0)); (Family_Inet, (others => 0));
Broadcast_Inet_Addr : constant Inet_Addr_Type := Broadcast_Inet_Addr : constant Inet_Addr_Type :=
(Family_Inet, (others => 255)); (Family_Inet, (others => 255));
Loopback_Inet_Addr : constant Inet_Addr_Type :=
(Family_Inet, (127, 0, 0, 1));
Unspecified_Group_Inet_Addr : constant Inet_Addr_Type :=
(Family_Inet, (224, 0, 0, 0));
All_Hosts_Group_Inet_Addr : constant Inet_Addr_Type :=
(Family_Inet, (224, 0, 0, 1));
All_Routers_Group_Inet_Addr : constant Inet_Addr_Type :=
(Family_Inet, (224, 0, 0, 2));
No_Sock_Addr : constant Sock_Addr_Type := (Family_Inet, No_Inet_Addr, 0); No_Sock_Addr : constant Sock_Addr_Type := (Family_Inet, No_Inet_Addr, 0);
......
...@@ -77,9 +77,6 @@ package body GNAT.Sockets.Thin.Task_Safe_NetDB is ...@@ -77,9 +77,6 @@ package body GNAT.Sockets.Thin.Task_Safe_NetDB is
pragma Import (Ada, Netdb_Data); pragma Import (Ada, Netdb_Data);
for Netdb_Data'Address use Buf; for Netdb_Data'Address use Buf;
pragma Unreferenced (H_Errnop);
-- VxWorks does not provide h_errno
begin begin
pragma Assert (Addr_Type = SOSC.AF_INET); pragma Assert (Addr_Type = SOSC.AF_INET);
pragma Assert (Addr_Len = In_Addr'Size / 8); pragma Assert (Addr_Len = In_Addr'Size / 8);
...@@ -88,6 +85,7 @@ package body GNAT.Sockets.Thin.Task_Safe_NetDB is ...@@ -88,6 +85,7 @@ package body GNAT.Sockets.Thin.Task_Safe_NetDB is
-- data we want to return. -- data we want to return.
if Netdb_Data'Size / 8 > Buflen then if Netdb_Data'Size / 8 > Buflen then
H_Errnop.all := SOSC.ERANGE;
return -1; return -1;
end if; end if;
...@@ -95,6 +93,7 @@ package body GNAT.Sockets.Thin.Task_Safe_NetDB is ...@@ -95,6 +93,7 @@ package body GNAT.Sockets.Thin.Task_Safe_NetDB is
Netdb_Data.Name'Address) Netdb_Data.Name'Address)
/= SOSC.OK /= SOSC.OK
then then
H_Errnop.all := C.int (Host_Errno);
return -1; return -1;
end if; end if;
...@@ -130,12 +129,10 @@ package body GNAT.Sockets.Thin.Task_Safe_NetDB is ...@@ -130,12 +129,10 @@ package body GNAT.Sockets.Thin.Task_Safe_NetDB is
Addr : C.int; Addr : C.int;
pragma Unreferenced (H_Errnop);
-- VxWorks does not provide h_errno
begin begin
Addr := VxWorks_hostGetByName (Name); Addr := VxWorks_hostGetByName (Name);
if Addr = SOSC.ERROR then if Addr = SOSC.ERROR then
H_Errnop.all := C.int (Host_Errno);
return -1; return -1;
end if; end if;
...@@ -149,6 +146,7 @@ package body GNAT.Sockets.Thin.Task_Safe_NetDB is ...@@ -149,6 +146,7 @@ package body GNAT.Sockets.Thin.Task_Safe_NetDB is
-- data we want to return. -- data we want to return.
if Netdb_Data'Size / 8 > Buflen then if Netdb_Data'Size / 8 > Buflen then
H_Errnop.all := SOSC.ERANGE;
return -1; return -1;
end if; end if;
......
...@@ -340,7 +340,6 @@ package body MLib.Prj is ...@@ -340,7 +340,6 @@ package body MLib.Prj is
Success : Boolean := False; Success : Boolean := False;
Library_Options : Variable_Value := Nil_Variable_Value; Library_Options : Variable_Value := Nil_Variable_Value;
Library_GCC : Variable_Value := Nil_Variable_Value;
Driver_Name : Name_Id := No_Name; Driver_Name : Name_Id := No_Name;
...@@ -1282,13 +1281,11 @@ package body MLib.Prj is ...@@ -1282,13 +1281,11 @@ package body MLib.Prj is
if Link then if Link then
-- If attribute Library_GCC was specified, get the driver name -- If attributes Library_GCC or Linker'Driver were specified, get the
-- driver name.
Library_GCC := if Data.Config.Shared_Lib_Driver /= No_File then
Value_Of (Name_Library_GCC, Data.Decl.Attributes, In_Tree); Driver_Name := Name_Id (Data.Config.Shared_Lib_Driver);
if not Library_GCC.Default then
Driver_Name := Library_GCC.Value;
end if; end if;
-- If attribute Library_Options was specified, add these additional -- If attribute Library_Options was specified, add these additional
......
...@@ -1842,6 +1842,15 @@ package body Prj.Nmsc is ...@@ -1842,6 +1842,15 @@ package body Prj.Nmsc is
Data.Config.Linker := Data.Config.Linker :=
Path_Name_Type (Attribute.Value.Value); Path_Name_Type (Attribute.Value.Value);
-- Linker'Driver is also used to link shared libraries
-- if the obsolescent attribute Library_GCC has not been
-- specified.
if Data.Config.Shared_Lib_Driver = No_File then
Data.Config.Shared_Lib_Driver :=
File_Name_Type (Attribute.Value.Value);
end if;
elsif Attribute.Name = Name_Required_Switches then elsif Attribute.Name = Name_Required_Switches then
-- Attribute Required_Switches: the minimum -- Attribute Required_Switches: the minimum
...@@ -2067,6 +2076,12 @@ package body Prj.Nmsc is ...@@ -2067,6 +2076,12 @@ package body Prj.Nmsc is
elsif Attribute.Name = Name_Library_GCC then elsif Attribute.Name = Name_Library_GCC then
Data.Config.Shared_Lib_Driver := Data.Config.Shared_Lib_Driver :=
File_Name_Type (Attribute.Value.Value); File_Name_Type (Attribute.Value.Value);
Error_Msg
(Project,
In_Tree,
"?Library_'G'C'C is an obsolescent attribute, " &
"use Linker''Driver instead",
Attribute.Value.Location);
elsif Attribute.Name = Name_Archive_Suffix then elsif Attribute.Name = Name_Archive_Suffix then
Data.Config.Archive_Suffix := Data.Config.Archive_Suffix :=
...@@ -3613,6 +3628,10 @@ package body Prj.Nmsc is ...@@ -3613,6 +3628,10 @@ package body Prj.Nmsc is
Prj.Util.Value_Of Prj.Util.Value_Of
(Snames.Name_Library_Ali_Dir, Attributes, In_Tree); (Snames.Name_Library_Ali_Dir, Attributes, In_Tree);
Lib_GCC : constant Prj.Variable_Value :=
Prj.Util.Value_Of
(Snames.Name_Library_GCC, Attributes, In_Tree);
The_Lib_Kind : constant Prj.Variable_Value := The_Lib_Kind : constant Prj.Variable_Value :=
Prj.Util.Value_Of Prj.Util.Value_Of
(Snames.Name_Library_Kind, Attributes, In_Tree); (Snames.Name_Library_Kind, Attributes, In_Tree);
...@@ -4205,15 +4224,55 @@ package body Prj.Nmsc is ...@@ -4205,15 +4224,55 @@ package body Prj.Nmsc is
Write_Line (Kind_Name); Write_Line (Kind_Name);
end if; end if;
if Data.Library_Kind /= Static and then if Data.Library_Kind /= Static then
Support_For_Libraries = Prj.Static_Only if Support_For_Libraries = Prj.Static_Only then
then
Error_Msg Error_Msg
(Project, In_Tree, (Project, In_Tree,
"only static libraries are supported " & "only static libraries are supported " &
"on this platform", "on this platform",
The_Lib_Kind.Location); The_Lib_Kind.Location);
Data.Library := False; Data.Library := False;
else
-- Check if (obsolescent) attribute Library_GCC or
-- Linker'Driver is declared.
if Lib_GCC.Value /= Empty_String then
Error_Msg
(Project,
In_Tree,
"?Library_'G'C'C is an obsolescent attribute, " &
"use Linker''Driver instead",
Lib_GCC.Location);
Data.Config.Shared_Lib_Driver :=
File_Name_Type (Lib_GCC.Value);
else
declare
Linker : constant Package_Id :=
Value_Of
(Name_Linker,
Data.Decl.Packages,
In_Tree);
Driver : constant Variable_Value :=
Value_Of
(Name => No_Name,
Attribute_Or_Array_Name =>
Name_Driver,
In_Package => Linker,
In_Tree =>
In_Tree);
begin
if Driver /= Nil_Variable_Value
and then Driver.Value /= Empty_String
then
Data.Config.Shared_Lib_Driver :=
File_Name_Type (Driver.Value);
end if;
end;
end if;
end if;
end if; end if;
end; end;
end if; end if;
......
...@@ -471,6 +471,11 @@ CND(EPROTONOSUPPORT, "Unknown protocol") ...@@ -471,6 +471,11 @@ CND(EPROTONOSUPPORT, "Unknown protocol")
#endif #endif
CND(EPROTOTYPE, "Unknown protocol type") CND(EPROTOTYPE, "Unknown protocol type")
#ifndef ERANGE
# define ERANGE -1
#endif
CND(ERANGE, "Result too large")
#ifndef ESHUTDOWN #ifndef ESHUTDOWN
# define ESHUTDOWN -1 # define ESHUTDOWN -1
#endif #endif
......
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