Commit dea1d3dc by Arnaud Charlet

[multiple changes]

2011-12-21  Thomas Quinot  <quinot@adacore.com>

	* thread.c, s-oscons-tmplt.c, init.c (pthread_condattr_setclock): For
	AIX 5.2, define as a dummy weak symbol in init.c.
	(CLOCK_RT_Ada): Set to CLOCK_MONOTONIC on all versions of AIX.

2011-12-21  Thomas Quinot  <quinot@adacore.com>

	* snames.ads-tmpl, sem_ch8.adb: Minor reformatting.
	* sem_prag.adb: Minor comment clarification.

2011-12-21  Vincent Celier  <celier@adacore.com>

	* prj-nmsc.adb (Report_No_Sources): New argument Lang for the
	language name as a Name_Id. Do not report no sources if language
	is not allowed.
	(Add_Source): Do not add source if language is not allowed.
	* prj.adb (Add_Restricted_Language): New procedure
	(Is_Allowed_Language): New function
	* prj.ads (Add_Restricted_Language): New procedure
	(Is_Allowed_Language): New function

From-SVN: r182577
parent 88115c2a
2011-12-21 Thomas Quinot <quinot@adacore.com>
* thread.c, s-oscons-tmplt.c, init.c (pthread_condattr_setclock): For
AIX 5.2, define as a dummy weak symbol in init.c.
(CLOCK_RT_Ada): Set to CLOCK_MONOTONIC on all versions of AIX.
2011-12-21 Thomas Quinot <quinot@adacore.com>
* snames.ads-tmpl, sem_ch8.adb: Minor reformatting.
* sem_prag.adb: Minor comment clarification.
2011-12-21 Vincent Celier <celier@adacore.com>
* prj-nmsc.adb (Report_No_Sources): New argument Lang for the
language name as a Name_Id. Do not report no sources if language
is not allowed.
(Add_Source): Do not add source if language is not allowed.
* prj.adb (Add_Restricted_Language): New procedure
(Is_Allowed_Language): New function
* prj.ads (Add_Restricted_Language): New procedure
(Is_Allowed_Language): New function
2011-12-21 Robert Dewar <dewar@adacore.com> 2011-12-21 Robert Dewar <dewar@adacore.com>
* exp_ch5.adb, sem_dim.adb, sem_dim.ads, sem_ch12.adb, prj-conf.adb: * exp_ch5.adb, sem_dim.adb, sem_dim.ads, sem_ch12.adb, prj-conf.adb:
......
...@@ -219,6 +219,19 @@ nanosleep (struct timestruc_t *Rqtp, struct timestruc_t *Rmtp) ...@@ -219,6 +219,19 @@ nanosleep (struct timestruc_t *Rqtp, struct timestruc_t *Rmtp)
#endif /* _AIXVERSION_430 */ #endif /* _AIXVERSION_430 */
/* Version of AIX before 5.3 don't have pthread_condattr_setclock:
* supply it as a weak symbol here so that if linking on a 5.3 or newer
* machine, we get the real one.
*/
#ifndef _AIXVERSION_530
#pragma weak pthread_condattr_setclock
int
pthread_condattr_setclock (pthread_condattr_t *attr, clockid_t cl) {
return 0;
}
#endif
static void static void
__gnat_error_handler (int sig, __gnat_error_handler (int sig,
siginfo_t *si ATTRIBUTE_UNUSED, siginfo_t *si ATTRIBUTE_UNUSED,
......
...@@ -486,6 +486,7 @@ package body Prj.Nmsc is ...@@ -486,6 +486,7 @@ package body Prj.Nmsc is
procedure Report_No_Sources procedure Report_No_Sources
(Project : Project_Id; (Project : Project_Id;
Lang : Name_Id;
Lang_Name : String; Lang_Name : String;
Data : Tree_Processing_Data; Data : Tree_Processing_Data;
Location : Source_Ptr; Location : Source_Ptr;
...@@ -642,6 +643,13 @@ package body Prj.Nmsc is ...@@ -642,6 +643,13 @@ package body Prj.Nmsc is
Source_To_Replace : Source_Id := No_Source; Source_To_Replace : Source_Id := No_Source;
begin begin
-- Nothing to do if the language is not one of the restricted ones
if not Is_Allowed_Language (Lang_Id.Name) then
Id := No_Source;
return;
end if;
-- Check if the same file name or unit is used in the prj tree -- Check if the same file name or unit is used in the prj tree
Add_Src := True; Add_Src := True;
...@@ -1020,6 +1028,56 @@ package body Prj.Nmsc is ...@@ -1020,6 +1028,56 @@ package body Prj.Nmsc is
(Project : Project_Id; (Project : Project_Id;
Data : in out Tree_Processing_Data) Data : in out Tree_Processing_Data)
is is
procedure Check_Aggregate
(Project : Project_Id;
Data : in out Tree_Processing_Data);
-- Check the aggregate project attributes, reject any not supported
-- attributes.
---------------------
-- Check_Aggregate --
---------------------
procedure Check_Aggregate
(Project : Project_Id;
Data : in out Tree_Processing_Data)
is
procedure Check_Not_Defined (Name : Name_Id);
-- Report an error if Var is defined
-----------------------
-- Check_Not_Defined --
-----------------------
procedure Check_Not_Defined (Name : Name_Id) is
Var : constant Prj.Variable_Value :=
Prj.Util.Value_Of
(Name,
Project.Decl.Attributes,
Data.Tree.Shared);
begin
if not Var.Default then
Error_Msg_Name_1 := Name;
Error_Msg
(Data.Flags, "wrong attribute %% in aggregate library",
Var.Location, Project);
end if;
end Check_Not_Defined;
begin
Check_Not_Defined (Snames.Name_Library_Dir);
Check_Not_Defined (Snames.Name_Library_Interface);
Check_Not_Defined (Snames.Name_Library_Name);
Check_Not_Defined (Snames.Name_Library_Ali_Dir);
Check_Not_Defined (Snames.Name_Library_Src_Dir);
Check_Not_Defined (Snames.Name_Library_Options);
Check_Not_Defined (Snames.Name_Library_Standalone);
Check_Not_Defined (Snames.Name_Library_Kind);
Check_Not_Defined (Snames.Name_Leading_Library_Options);
Check_Not_Defined (Snames.Name_Library_Version);
end Check_Aggregate;
Shared : constant Shared_Project_Tree_Data_Access := Data.Tree.Shared; Shared : constant Shared_Project_Tree_Data_Access := Data.Tree.Shared;
Prj_Data : Project_Processing_Data; Prj_Data : Project_Processing_Data;
...@@ -1058,7 +1116,12 @@ package body Prj.Nmsc is ...@@ -1058,7 +1116,12 @@ package body Prj.Nmsc is
Check_Configuration (Project, Data); Check_Configuration (Project, Data);
if Project.Qualifier /= Aggregate then if Project.Qualifier = Aggregate then
-- For aggregate project checks that no library attributes are
-- defined.
Check_Aggregate (Project, Data);
else
Check_Library_Attributes (Project, Data); Check_Library_Attributes (Project, Data);
Check_Package_Naming (Project, Data); Check_Package_Naming (Project, Data);
...@@ -7745,6 +7808,7 @@ package body Prj.Nmsc is ...@@ -7745,6 +7808,7 @@ package body Prj.Nmsc is
if Source = No_Source then if Source = No_Source then
Report_No_Sources Report_No_Sources
(Project.Project, (Project.Project,
Language.Name,
Get_Name_String (Language.Display_Name), Get_Name_String (Language.Display_Name),
Data, Data,
Project.Source_List_File_Location, Project.Source_List_File_Location,
...@@ -8191,12 +8255,14 @@ package body Prj.Nmsc is ...@@ -8191,12 +8255,14 @@ package body Prj.Nmsc is
procedure Report_No_Sources procedure Report_No_Sources
(Project : Project_Id; (Project : Project_Id;
Lang : Name_Id;
Lang_Name : String; Lang_Name : String;
Data : Tree_Processing_Data; Data : Tree_Processing_Data;
Location : Source_Ptr; Location : Source_Ptr;
Continuation : Boolean := False) Continuation : Boolean := False)
is is
begin begin
if Is_Allowed_Language (Lang) then
case Data.Flags.When_No_Sources is case Data.Flags.When_No_Sources is
when Silent => when Silent =>
null; null;
...@@ -8217,6 +8283,7 @@ package body Prj.Nmsc is ...@@ -8217,6 +8283,7 @@ package body Prj.Nmsc is
end if; end if;
end; end;
end case; end case;
end if;
end Report_No_Sources; end Report_No_Sources;
---------------------- ----------------------
......
...@@ -42,6 +42,17 @@ with GNAT.HTable; ...@@ -42,6 +42,17 @@ with GNAT.HTable;
package body Prj is package body Prj is
type Restricted_Lang;
type Restricted_Lang_Access is access Restricted_Lang;
type Restricted_Lang is record
Name : Name_Id;
Next : Restricted_Lang_Access;
end record;
Restricted_Languages : Restricted_Lang_Access := null;
-- When null, all languages are allowed, otherwise only the languages in
-- the list are allowed.
Object_Suffix : constant String := Get_Target_Object_Suffix.all; Object_Suffix : constant String := Get_Target_Object_Suffix.all;
-- File suffix for object files -- File suffix for object files
...@@ -86,6 +97,20 @@ package body Prj is ...@@ -86,6 +97,20 @@ package body Prj is
function Contains_ALI_Files (Dir : Path_Name_Type) return Boolean; function Contains_ALI_Files (Dir : Path_Name_Type) return Boolean;
-- Return True if there is at least one ALI file in the directory Dir -- Return True if there is at least one ALI file in the directory Dir
-----------------------------
-- Add_Restricted_Language --
-----------------------------
procedure Add_Restricted_Language (Name : String) is
N : String (1 .. Name'Length) := Name;
begin
To_Lower (N);
Name_Len := 0;
Add_Str_To_Name_Buffer (N);
Restricted_Languages :=
new Restricted_Lang'(Name => Name_Find, Next => Restricted_Languages);
end Add_Restricted_Language;
------------------- -------------------
-- Add_To_Buffer -- -- Add_To_Buffer --
------------------- -------------------
...@@ -360,6 +385,30 @@ package body Prj is ...@@ -360,6 +385,30 @@ package body Prj is
return Name_Find; return Name_Find;
end Extend_Name; end Extend_Name;
-------------------------
-- Is_Allowed_Language --
-------------------------
function Is_Allowed_Language (Name : Name_Id) return Boolean is
R : Restricted_Lang_Access := Restricted_Languages;
Lang : constant String := Get_Name_String (Name);
begin
if R = null then
return True;
else
while R /= null loop
if Get_Name_String (R.Name) = Lang then
return True;
end if;
R := R.Next;
end loop;
return False;
end if;
end Is_Allowed_Language;
--------------------- ---------------------
-- Project_Changed -- -- Project_Changed --
--------------------- ---------------------
...@@ -1549,7 +1598,9 @@ package body Prj is ...@@ -1549,7 +1598,9 @@ package body Prj is
procedure Debug_Output (Str : String) is procedure Debug_Output (Str : String) is
begin begin
if Current_Verbosity > Default then if Current_Verbosity > Default then
Set_Standard_Error;
Write_Line ((1 .. Debug_Level * 2 => ' ') & Str); Write_Line ((1 .. Debug_Level * 2 => ' ') & Str);
Set_Standard_Output;
end if; end if;
end Debug_Output; end Debug_Output;
...@@ -1560,7 +1611,9 @@ package body Prj is ...@@ -1560,7 +1611,9 @@ package body Prj is
procedure Debug_Indent is procedure Debug_Indent is
begin begin
if Current_Verbosity = High then if Current_Verbosity = High then
Set_Standard_Error;
Write_Str ((1 .. Debug_Level * 2 => ' ')); Write_Str ((1 .. Debug_Level * 2 => ' '));
Set_Standard_Output;
end if; end if;
end Debug_Indent; end Debug_Indent;
...@@ -1572,6 +1625,7 @@ package body Prj is ...@@ -1572,6 +1625,7 @@ package body Prj is
begin begin
if Current_Verbosity = High then if Current_Verbosity = High then
Debug_Indent; Debug_Indent;
Set_Standard_Error;
Write_Str (Str); Write_Str (Str);
if Str2 = No_Name then if Str2 = No_Name then
...@@ -1579,6 +1633,7 @@ package body Prj is ...@@ -1579,6 +1633,7 @@ package body Prj is
else else
Write_Line (" """ & Get_Name_String (Str2) & '"'); Write_Line (" """ & Get_Name_String (Str2) & '"');
end if; end if;
Set_Standard_Output;
end if; end if;
end Debug_Output; end Debug_Output;
......
...@@ -41,6 +41,14 @@ with GNAT.OS_Lib; use GNAT.OS_Lib; ...@@ -41,6 +41,14 @@ with GNAT.OS_Lib; use GNAT.OS_Lib;
package Prj is package Prj is
procedure Add_Restricted_Language (Name : String);
-- Call by gprbuild for each language specify by switch
-- --restricted-to-languages=.
function Is_Allowed_Language (Name : Name_Id) return Boolean;
-- Returns True if --restricted-to-languages= is not used or if Name
-- is one of the restricted languages.
All_Other_Names : constant Name_Id := Names_High_Bound; All_Other_Names : constant Name_Id := Names_High_Bound;
-- Name used to replace others as an index of an associative array -- Name used to replace others as an index of an associative array
-- attribute in situations where this is allowed. -- attribute in situations where this is allowed.
...@@ -1370,6 +1378,10 @@ package Prj is ...@@ -1370,6 +1378,10 @@ package Prj is
Extended : Project_Id) return Boolean; Extended : Project_Id) return Boolean;
-- Return True if Extending is extending the Extended project -- Return True if Extending is extending the Extended project
function Is_Ext
(Extending : Project_Id;
Extended : Project_Id) return Boolean renames Is_Extending;
function Has_Ada_Sources (Data : Project_Id) return Boolean; function Has_Ada_Sources (Data : Project_Id) return Boolean;
-- Return True if the project has Ada sources -- Return True if the project has Ada sources
......
...@@ -1379,7 +1379,7 @@ CND(CLOCK_THREAD_CPUTIME_ID, "Thread CPU clock") ...@@ -1379,7 +1379,7 @@ CND(CLOCK_THREAD_CPUTIME_ID, "Thread CPU clock")
/* There's no clock_gettime or clock_id's on Darwin, generate a dummy value */ /* There's no clock_gettime or clock_id's on Darwin, generate a dummy value */
# define CLOCK_RT_Ada "-1" # define CLOCK_RT_Ada "-1"
#elif defined(FreeBSD) || (defined(_AIX) && defined(_AIXVERSION_530)) #elif defined(FreeBSD) || defined(_AIX)
/** On these platforms use system provided monotonic clock instead of /** On these platforms use system provided monotonic clock instead of
** the default CLOCK_REALTIME. We then need to set up cond var attributes ** the default CLOCK_REALTIME. We then need to set up cond var attributes
** appropriately (see thread.c). ** appropriately (see thread.c).
......
...@@ -8031,7 +8031,7 @@ package body Sem_Ch8 is ...@@ -8031,7 +8031,7 @@ package body Sem_Ch8 is
end if; end if;
end Use_Class_Wide_Operations; end Use_Class_Wide_Operations;
-- Start of processing for Use_One_Type; -- Start of processing for Use_One_Type
begin begin
-- It is the type determined by the subtype mark (8.4(8)) whose -- It is the type determined by the subtype mark (8.4(8)) whose
......
...@@ -14887,7 +14887,8 @@ package body Sem_Prag is ...@@ -14887,7 +14887,8 @@ package body Sem_Prag is
----------------------------------------- -----------------------------------------
-- This function makes use of the following static table which indicates -- This function makes use of the following static table which indicates
-- whether a given pragma is significant. -- whether appearance of some name in a given pragma is to be considered
-- as a reference for the purposes of warnings about unreferenced objects.
-- -1 indicates that references in any argument position are significant -- -1 indicates that references in any argument position are significant
-- 0 indicates that appearance in any argument is not significant -- 0 indicates that appearance in any argument is not significant
......
...@@ -35,8 +35,8 @@ package Snames is ...@@ -35,8 +35,8 @@ package Snames is
-- This package contains definitions of standard names (i.e. entries in the -- This package contains definitions of standard names (i.e. entries in the
-- Names table) that are used throughout the GNAT compiler. It also contains -- Names table) that are used throughout the GNAT compiler. It also contains
-- the definitions of some enumeration types whose definitions are tied to -- the definitions of some enumeration types whose definitions are tied to the
-- the order of these preset names. -- order of these preset names.
------------------ ------------------
-- Preset Names -- -- Preset Names --
...@@ -51,13 +51,13 @@ package Snames is ...@@ -51,13 +51,13 @@ package Snames is
-- additional pragmas or attributes are introduced which might otherwise -- additional pragmas or attributes are introduced which might otherwise
-- cause a duplicate, then list it only once in this table, and adjust the -- cause a duplicate, then list it only once in this table, and adjust the
-- definition of the functions for testing for pragma names and attribute -- definition of the functions for testing for pragma names and attribute
-- names, and returning their ID values. Of course everything is simpler -- names, and returning their ID values. Of course everything is simpler if
-- if no such duplications occur! -- no such duplications occur!
-- First we have the one character names used to optimize the lookup -- First we have the one character names used to optimize the lookup
-- process for one character identifiers (to avoid the hashing in this -- process for one character identifiers (to avoid the hashing in this
-- case) There are a full 256 of these, but only the entries for lower -- case) There are a full 256 of these, but only the entries for lower case
-- case and upper case letters have identifiers -- and upper case letters have identifiers
-- The lower case letter entries are used for one character identifiers -- The lower case letter entries are used for one character identifiers
-- appearing in the source, for example in pragma Interface (C). -- appearing in the source, for example in pragma Interface (C).
...@@ -90,8 +90,8 @@ package Snames is ...@@ -90,8 +90,8 @@ package Snames is
Name_Z : constant Name_Id := First_Name_Id + Character'Pos ('z'); Name_Z : constant Name_Id := First_Name_Id + Character'Pos ('z');
-- The upper case letter entries are used by expander code for local -- The upper case letter entries are used by expander code for local
-- variables that do not require unique names (e.g. formal parameter -- variables that do not require unique names (e.g. formal parameter names
-- names in constructed procedures) -- in constructed procedures).
Name_uA : constant Name_Id := First_Name_Id + Character'Pos ('A'); Name_uA : constant Name_Id := First_Name_Id + Character'Pos ('A');
Name_uB : constant Name_Id := First_Name_Id + Character'Pos ('B'); Name_uB : constant Name_Id := First_Name_Id + Character'Pos ('B');
...@@ -291,9 +291,9 @@ package Snames is ...@@ -291,9 +291,9 @@ package Snames is
Name_Obj_TypeCode : constant Name_Id := N + $; Name_Obj_TypeCode : constant Name_Id := N + $;
Name_Stub : constant Name_Id := N + $; Name_Stub : constant Name_Id := N + $;
-- Operator Symbol entries. The actual names have an upper case O at -- Operator Symbol entries. The actual names have an upper case O at the
-- the start in place of the Op_ prefix (e.g. the actual name that -- start in place of the Op_ prefix (e.g. the actual name that corresponds
-- corresponds to Name_Op_Abs is "Oabs". -- to Name_Op_Abs is "Oabs".
First_Operator_Name : constant Name_Id := N + $; First_Operator_Name : constant Name_Id := N + $;
Name_Op_Abs : constant Name_Id := N + $; -- "abs" Name_Op_Abs : constant Name_Id := N + $; -- "abs"
...@@ -325,21 +325,21 @@ package Snames is ...@@ -325,21 +325,21 @@ package Snames is
-- The entries marked GNAT are pragmas that are defined by GNAT and that -- The entries marked GNAT are pragmas that are defined by GNAT and that
-- are implemented in all modes (Ada 83, Ada 95, and Ada 2005) Complete -- are implemented in all modes (Ada 83, Ada 95, and Ada 2005) Complete
-- descriptions of the syntax of these implementation dependent pragmas -- descriptions of the syntax of these implementation dependent pragmas may
-- may be found in the appropriate section in unit Sem_Prag in file -- be found in the appropriate section in unit Sem_Prag in file
-- sem-prag.adb, and they are documented in the GNAT reference manual. -- sem-prag.adb, and they are documented in the GNAT reference manual.
-- The entries marked Ada 05 are Ada 2005 pragmas. They are implemented -- The entries marked Ada 05 are Ada 2005 pragmas. They are implemented in
-- in Ada 83 and Ada 95 mode as well, where they are technically considered -- Ada 83 and Ada 95 mode as well, where they are technically considered to
-- to be implementation dependent pragmas. -- be implementation dependent pragmas.
-- The entries marked Ada 12 are Ada 2012 pragmas. They are implemented -- The entries marked Ada 12 are Ada 2012 pragmas. They are implemented in
-- in Ada 83, Ada 95, and Ada 2005 mode as well, where they are technically -- Ada 83, Ada 95, and Ada 2005 mode as well, where they are technically
-- considered to be implementation dependent pragmas. -- considered to be implementation dependent pragmas.
-- The entries marked VMS are VMS specific pragmas that are recognized -- The entries marked VMS are VMS specific pragmas that are recognized only
-- only in OpenVMS versions of GNAT. They are ignored in other versions -- in OpenVMS versions of GNAT. They are ignored in other versions with an
-- with an appropriate warning. -- appropriate warning.
-- The entries marked AAMP are AAMP specific pragmas that are recognized -- The entries marked AAMP are AAMP specific pragmas that are recognized
-- only in GNAT for the AAMP. They are ignored in other versions with -- only in GNAT for the AAMP. They are ignored in other versions with
...@@ -381,11 +381,11 @@ package Snames is ...@@ -381,11 +381,11 @@ package Snames is
Name_Extensions_Allowed : constant Name_Id := N + $; -- GNAT Name_Extensions_Allowed : constant Name_Id := N + $; -- GNAT
Name_External_Name_Casing : constant Name_Id := N + $; -- GNAT Name_External_Name_Casing : constant Name_Id := N + $; -- GNAT
-- Note: Fast_Math is not in this list because its name matches -- GNAT -- Note: Fast_Math is not in this list because its name matches the name of
-- the name of the corresponding attribute. However, it is -- the corresponding attribute. However, it is included in the definition
-- included in the definition of the type Pragma_Id, and the -- of the type Pragma_Id, and the functions Get_Pragma_Id,
-- functions Get_Pragma_Id, Is_[Configuration_]Pragma_Id, and -- Is_[Configuration_]Pragma_Id, and correctly recognize and process
-- correctly recognize and process Fast_Math. -- Fast_Math.
Name_Favor_Top_Level : constant Name_Id := N + $; -- GNAT Name_Favor_Top_Level : constant Name_Id := N + $; -- GNAT
Name_Float_Representation : constant Name_Id := N + $; -- GNAT Name_Float_Representation : constant Name_Id := N + $; -- GNAT
...@@ -432,11 +432,10 @@ package Snames is ...@@ -432,11 +432,10 @@ package Snames is
Name_Abort_Defer : constant Name_Id := N + $; -- GNAT Name_Abort_Defer : constant Name_Id := N + $; -- GNAT
Name_All_Calls_Remote : constant Name_Id := N + $; Name_All_Calls_Remote : constant Name_Id := N + $;
-- Note: AST_Entry is not in this list because its name matches -- VMS -- Note: AST_Entry is not in this list because its name matches the name of
-- the name of the corresponding attribute. However, it is -- the corresponding attribute. However, it is included in the definition
-- included in the definition of the type Pragma_Id, and the -- of the type Pragma_Id, and the functions Get_Pragma_Id and Is_Pragma_Id
-- functions Get_Pragma_Id and Is_Pragma_Id correctly recognize -- correctly recognize and process Name_AST_Entry.
-- and process Name_AST_Entry.
Name_Assert : constant Name_Id := N + $; -- Ada 05 Name_Assert : constant Name_Id := N + $; -- Ada 05
Name_Asynchronous : constant Name_Id := N + $; Name_Asynchronous : constant Name_Id := N + $;
...@@ -485,11 +484,10 @@ package Snames is ...@@ -485,11 +484,10 @@ package Snames is
Name_Inline_Generic : constant Name_Id := N + $; -- GNAT Name_Inline_Generic : constant Name_Id := N + $; -- GNAT
Name_Inspection_Point : constant Name_Id := N + $; Name_Inspection_Point : constant Name_Id := N + $;
-- Note: Interface is not in this list because its name -- GNAT -- Note: Interface is not in this list because its name matches an Ada 05
-- matches an Ada 05 keyword. However it is included in -- keyword. However it is included in the definition of the type
-- the definition of the type Attribute_Id, and the functions -- Attribute_Id, and the functions Get_Pragma_Id and Is_Pragma_Id correctly
-- Get_Pragma_Id and Is_Pragma_Id correctly recognize and -- recognize and process Name_Storage_Size.
-- process Name_Storage_Size.
Name_Interface_Name : constant Name_Id := N + $; -- GNAT Name_Interface_Name : constant Name_Id := N + $; -- GNAT
Name_Interrupt_Handler : constant Name_Id := N + $; Name_Interrupt_Handler : constant Name_Id := N + $;
...@@ -524,11 +522,11 @@ package Snames is ...@@ -524,11 +522,11 @@ package Snames is
Name_Preelaborate : constant Name_Id := N + $; Name_Preelaborate : constant Name_Id := N + $;
Name_Preelaborate_05 : constant Name_Id := N + $; -- GNAT Name_Preelaborate_05 : constant Name_Id := N + $; -- GNAT
-- Note: Priority is not in this list because its name matches -- Note: Priority is not in this list because its name matches the name of
-- the name of the corresponding attribute. However, it is -- the corresponding attribute. However, it is included in the definition
-- included in the definition of the type Pragma_Id, and the -- of the type Pragma_Id, and the functions Get_Pragma_Id and Is_Pragma_Id
-- functions Get_Pragma_Id and Is_Pragma_Id correctly recognize -- correctly recognize and process Priority. Priority is a standard Ada 95
-- and process Priority. Priority is a standard Ada 95 pragma. -- pragma.
Name_Psect_Object : constant Name_Id := N + $; -- VMS Name_Psect_Object : constant Name_Id := N + $; -- VMS
Name_Pure : constant Name_Id := N + $; Name_Pure : constant Name_Id := N + $;
...@@ -542,14 +540,13 @@ package Snames is ...@@ -542,14 +540,13 @@ package Snames is
Name_Shared : constant Name_Id := N + $; -- Ada 83 Name_Shared : constant Name_Id := N + $; -- Ada 83
Name_Shared_Passive : constant Name_Id := N + $; Name_Shared_Passive : constant Name_Id := N + $;
-- Note: Storage_Size is not in this list because its name -- Note: Storage_Size is not in this list because its name matches the name
-- matches the name of the corresponding attribute. However, -- of the corresponding attribute. However, it is included in the
-- it is included in the definition of the type Attribute_Id, -- definition of the type Attribute_Id, and the functions Get_Pragma_Id and
-- and the functions Get_Pragma_Id and Is_Pragma_Id correctly -- Is_Pragma_Id correctly recognize and process Name_Storage_Size.
-- recognize and process Name_Storage_Size.
-- Note: Storage_Unit is also omitted from the list because -- Note: Storage_Unit is also omitted from the list because of a clash with
-- of a clash with an attribute name, and is treated similarly. -- an attribute name, and is treated similarly.
Name_Source_Reference : constant Name_Id := N + $; -- GNAT Name_Source_Reference : constant Name_Id := N + $; -- GNAT
Name_Static_Elaboration_Desired : constant Name_Id := N + $; -- GNAT Name_Static_Elaboration_Desired : constant Name_Id := N + $; -- GNAT
...@@ -580,8 +577,8 @@ package Snames is ...@@ -580,8 +577,8 @@ package Snames is
-- Language convention names for pragma Convention/Export/Import/Interface -- Language convention names for pragma Convention/Export/Import/Interface
-- Note that Name_C is not included in this list, since it was already -- Note that Name_C is not included in this list, since it was already
-- declared earlier in the context of one-character identifier names -- declared earlier in the context of one-character identifier names (where
-- (where the order is critical to the fast look up process). -- the order is critical to the fast look up process).
-- Note: there are no convention names corresponding to the conventions -- Note: there are no convention names corresponding to the conventions
-- Entry and Protected, this is because these conventions cannot be -- Entry and Protected, this is because these conventions cannot be
...@@ -721,10 +718,10 @@ package Snames is ...@@ -721,10 +718,10 @@ package Snames is
-- are attributes that are defined in Ada 83, but not in Ada 95. These -- are attributes that are defined in Ada 83, but not in Ada 95. These
-- attributes are implemented in both Ada 83 and Ada 95 modes in GNAT. -- attributes are implemented in both Ada 83 and Ada 95 modes in GNAT.
-- The entries marked GNAT are attributes that are defined by GNAT -- The entries marked GNAT are attributes that are defined by GNAT and
-- and implemented in both Ada 83 and Ada 95 modes. Full descriptions -- implemented in both Ada 83 and Ada 95 modes. Full descriptions of these
-- of these implementation dependent attributes may be found in the -- implementation dependent attributes may be found in the appropriate
-- appropriate section in package Sem_Attr in file sem-attr.ads. -- section in Sem_Attr.
-- The entries marked VMS are recognized only in OpenVMS implementations -- The entries marked VMS are recognized only in OpenVMS implementations
-- of GNAT, and are treated as illegal in all other contexts. -- of GNAT, and are treated as illegal in all other contexts.
...@@ -900,8 +897,8 @@ package Snames is ...@@ -900,8 +897,8 @@ package Snames is
-- Remaining attributes are ones that return entities -- Remaining attributes are ones that return entities
-- Note that Elab_Subp_Body is not considered to be a valid attribute -- Note that Elab_Subp_Body is not considered to be a valid attribute name
-- name unless we are operating in CodePeer mode. -- unless we are operating in CodePeer mode.
First_Entity_Attribute_Name : constant Name_Id := N + $; First_Entity_Attribute_Name : constant Name_Id := N + $;
Name_Elab_Body : constant Name_Id := N + $; -- GNAT Name_Elab_Body : constant Name_Id := N + $; -- GNAT
...@@ -929,9 +926,9 @@ package Snames is ...@@ -929,9 +926,9 @@ package Snames is
-- Names of recognized queuing policy identifiers -- Names of recognized queuing policy identifiers
-- Note: policies are identified by the first character of the -- Note: policies are identified by the first character of the name (e.g. F
-- name (e.g. F for FIFO_Queuing). If new policy names are added, -- for FIFO_Queuing). If new policy names are added, the first character
-- the first character must be distinct. -- must be distinct.
First_Queuing_Policy_Name : constant Name_Id := N + $; First_Queuing_Policy_Name : constant Name_Id := N + $;
Name_FIFO_Queuing : constant Name_Id := N + $; Name_FIFO_Queuing : constant Name_Id := N + $;
...@@ -940,9 +937,9 @@ package Snames is ...@@ -940,9 +937,9 @@ package Snames is
-- Names of recognized task dispatching policy identifiers -- Names of recognized task dispatching policy identifiers
-- Note: policies are identified by the first character of the -- Note: policies are identified by the first character of the name (e.g. F
-- name (e.g. F for FIFO_Within_Priorities). If new policy names -- for FIFO_Within_Priorities). If new policy names are added, the first
-- are added, the first character must be distinct. -- character must be distinct.
First_Task_Dispatching_Policy_Name : constant Name_Id := N + $; First_Task_Dispatching_Policy_Name : constant Name_Id := N + $;
Name_EDF_Across_Priorities : constant Name_Id := N + $; Name_EDF_Across_Priorities : constant Name_Id := N + $;
...@@ -1088,8 +1085,8 @@ package Snames is ...@@ -1088,8 +1085,8 @@ package Snames is
Name_Raise_Exception : constant Name_Id := N + $; Name_Raise_Exception : constant Name_Id := N + $;
-- Additional reserved words and identifiers used in GNAT Project Files -- Additional reserved words and identifiers used in GNAT Project Files
-- Note that Name_External is already previously declared -- Note that Name_External is already previously declared.
-- The names with the -- GB annotation are only used in gprbuild -- The names with the -- GB annotation are only used in gprbuild.
Name_Aggregate : constant Name_Id := N + $; Name_Aggregate : constant Name_Id := N + $;
Name_Archive_Builder : constant Name_Id := N + $; Name_Archive_Builder : constant Name_Id := N + $;
......
...@@ -37,6 +37,21 @@ ...@@ -37,6 +37,21 @@
# include <pthread.h> # include <pthread.h>
# include <time.h> # include <time.h>
#ifndef _AIXVERSION_530
/* We use the same runtime library for AIX 5.2 and 5.3, but pthread_condattr_
* setclock exists only on the latter, so for the former provide a dummy
* implementation (declared below, weak symbol defined in init.c).
*
* Note: this means that under AIX 5.2 we'll be using CLOCK_MONOTONIC
* timestamps from clock_gettime() as arguments to pthread_cond_timedwait,
* which expects a CLOCK_REALTIME value, which is technically wrong, but
* inocuous in practice on that particular platform since both clocks happen
* to use close epochs.
*/
extern int pthread_condattr_setclock (pthread_condattr_t *attr, clockid_t cl);
#endif
int int
__gnat_pthread_condattr_setup(pthread_condattr_t *attr) { __gnat_pthread_condattr_setup(pthread_condattr_t *attr) {
/* /*
......
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