Commit a5dd23a7 by Pascal Obry Committed by Arnaud Charlet

sem_prag.adb (Process_Convention): A dispatching call cannot have a stdcall calling convention.

2011-11-21  Pascal Obry  <obry@adacore.com>

	* sem_prag.adb (Process_Convention): A dispatching call cannot
	have a stdcall calling convention.

2011-11-21  Pascal Obry  <obry@adacore.com>

	* s-taprop-linux.adb (Initialize_Lock): Do not allocate a
	mutex attribute as not needed.
	(Initialize_TCB): Likewise.
	(Initialize): Likewise.

From-SVN: r181564
parent a4901c08
2011-11-21 Pascal Obry <obry@adacore.com>
* sem_prag.adb (Process_Convention): A dispatching call cannot
have a stdcall calling convention.
2011-11-21 Pascal Obry <obry@adacore.com>
* s-taprop-linux.adb (Initialize_Lock): Do not allocate a
mutex attribute as not needed.
(Initialize_TCB): Likewise.
(Initialize): Likewise.
2011-11-21 Robert Dewar <dewar@adacore.com> 2011-11-21 Robert Dewar <dewar@adacore.com>
* sem_ch6.adb (Is_Public_Subprogram_For): New procedure * sem_ch6.adb (Is_Public_Subprogram_For): New procedure
......
...@@ -291,14 +291,10 @@ package body System.Task_Primitives.Operations is ...@@ -291,14 +291,10 @@ package body System.Task_Primitives.Operations is
else else
declare declare
Mutex_Attr : aliased pthread_mutexattr_t; Result : Interfaces.C.int;
Result : Interfaces.C.int;
begin begin
Result := pthread_mutexattr_init (Mutex_Attr'Access); Result := pthread_mutex_init (L.WO'Access, null);
pragma Assert (Result = 0);
Result := pthread_mutex_init (L.WO'Access, Mutex_Attr'Access);
pragma Assert (Result = 0 or else Result = ENOMEM); pragma Assert (Result = 0 or else Result = ENOMEM);
...@@ -315,14 +311,10 @@ package body System.Task_Primitives.Operations is ...@@ -315,14 +311,10 @@ package body System.Task_Primitives.Operations is
is is
pragma Unreferenced (Level); pragma Unreferenced (Level);
Mutex_Attr : aliased pthread_mutexattr_t; Result : Interfaces.C.int;
Result : Interfaces.C.int;
begin begin
Result := pthread_mutexattr_init (Mutex_Attr'Access); Result := pthread_mutex_init (L, null);
pragma Assert (Result = 0);
Result := pthread_mutex_init (L, Mutex_Attr'Access);
pragma Assert (Result = 0 or else Result = ENOMEM); pragma Assert (Result = 0 or else Result = ENOMEM);
...@@ -817,9 +809,8 @@ package body System.Task_Primitives.Operations is ...@@ -817,9 +809,8 @@ package body System.Task_Primitives.Operations is
-------------------- --------------------
procedure Initialize_TCB (Self_ID : Task_Id; Succeeded : out Boolean) is procedure Initialize_TCB (Self_ID : Task_Id; Succeeded : out Boolean) is
Mutex_Attr : aliased pthread_mutexattr_t; Cond_Attr : aliased pthread_condattr_t;
Cond_Attr : aliased pthread_condattr_t; Result : Interfaces.C.int;
Result : Interfaces.C.int;
begin begin
-- Give the task a unique serial number -- Give the task a unique serial number
...@@ -831,11 +822,8 @@ package body System.Task_Primitives.Operations is ...@@ -831,11 +822,8 @@ package body System.Task_Primitives.Operations is
Self_ID.Common.LL.Thread := Null_Thread_Id; Self_ID.Common.LL.Thread := Null_Thread_Id;
if not Single_Lock then if not Single_Lock then
Result := pthread_mutexattr_init (Mutex_Attr'Access);
pragma Assert (Result = 0);
Result := Result :=
pthread_mutex_init (Self_ID.Common.LL.L'Access, Mutex_Attr'Access); pthread_mutex_init (Self_ID.Common.LL.L'Access, null);
pragma Assert (Result = 0 or else Result = ENOMEM); pragma Assert (Result = 0 or else Result = ENOMEM);
if Result /= 0 then if Result /= 0 then
...@@ -1081,9 +1069,8 @@ package body System.Task_Primitives.Operations is ...@@ -1081,9 +1069,8 @@ package body System.Task_Primitives.Operations is
---------------- ----------------
procedure Initialize (S : in out Suspension_Object) is procedure Initialize (S : in out Suspension_Object) is
Mutex_Attr : aliased pthread_mutexattr_t; Cond_Attr : aliased pthread_condattr_t;
Cond_Attr : aliased pthread_condattr_t; Result : Interfaces.C.int;
Result : Interfaces.C.int;
begin begin
-- Initialize internal state (always to False (RM D.10(6))) -- Initialize internal state (always to False (RM D.10(6)))
...@@ -1093,10 +1080,7 @@ package body System.Task_Primitives.Operations is ...@@ -1093,10 +1080,7 @@ package body System.Task_Primitives.Operations is
-- Initialize internal mutex -- Initialize internal mutex
Result := pthread_mutexattr_init (Mutex_Attr'Access); Result := pthread_mutex_init (S.L'Access, null);
pragma Assert (Result = 0);
Result := pthread_mutex_init (S.L'Access, Mutex_Attr'Access);
pragma Assert (Result = 0 or else Result = ENOMEM); pragma Assert (Result = 0 or else Result = ENOMEM);
......
...@@ -3527,8 +3527,9 @@ package body Sem_Prag is ...@@ -3527,8 +3527,9 @@ package body Sem_Prag is
-- For Stdcall, a subprogram, variable or subprogram type is required -- For Stdcall, a subprogram, variable or subprogram type is required
if C = Convention_Stdcall if C = Convention_Stdcall
and then not Is_Subprogram (E) and then
and then not Is_Generic_Subprogram (E) ((not Is_Subprogram (E) and then not Is_Generic_Subprogram (E))
or else Is_Dispatching_Operation (E))
and then Ekind (E) /= E_Variable and then Ekind (E) /= E_Variable
and then not and then not
(Is_Access_Type (E) (Is_Access_Type (E)
......
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