Commit b2c6b35f by Hristian Kirtchev Committed by Arnaud Charlet

exp_attr.adb (Find_Stream_Subprogram): Check the base type instead of the type when...

2008-07-31  Hristian Kirtchev  <kirtchev@adacore.com>

	* exp_attr.adb (Find_Stream_Subprogram): Check the base type instead
	of the type when looking for stream subprograms for type String,
	Wide_String and Wide_Wide_String.
	
	* s-ststop.adb: Change the initialization expression of constant
	Use_Block_IO.

From-SVN: r138383
parent a6649576
...@@ -5314,7 +5314,8 @@ package body Exp_Attr is ...@@ -5314,7 +5314,8 @@ package body Exp_Attr is
(Typ : Entity_Id; (Typ : Entity_Id;
Nam : TSS_Name_Type) return Entity_Id Nam : TSS_Name_Type) return Entity_Id
is is
Ent : constant Entity_Id := TSS (Typ, Nam); Base_Typ : constant Entity_Id := Base_Type (Typ);
Ent : constant Entity_Id := TSS (Typ, Nam);
begin begin
if Present (Ent) then if Present (Ent) then
...@@ -5340,7 +5341,7 @@ package body Exp_Attr is ...@@ -5340,7 +5341,7 @@ package body Exp_Attr is
-- String as defined in package Ada -- String as defined in package Ada
if Typ = Standard_String then if Base_Typ = Standard_String then
if Nam = TSS_Stream_Input then if Nam = TSS_Stream_Input then
return RTE (RE_String_Input); return RTE (RE_String_Input);
...@@ -5356,7 +5357,7 @@ package body Exp_Attr is ...@@ -5356,7 +5357,7 @@ package body Exp_Attr is
-- Wide_String as defined in package Ada -- Wide_String as defined in package Ada
elsif Typ = Standard_Wide_String then elsif Base_Typ = Standard_Wide_String then
if Nam = TSS_Stream_Input then if Nam = TSS_Stream_Input then
return RTE (RE_Wide_String_Input); return RTE (RE_Wide_String_Input);
...@@ -5372,7 +5373,7 @@ package body Exp_Attr is ...@@ -5372,7 +5373,7 @@ package body Exp_Attr is
-- Wide_Wide_String as defined in package Ada -- Wide_Wide_String as defined in package Ada
elsif Typ = Standard_Wide_Wide_String then elsif Base_Typ = Standard_Wide_Wide_String then
if Nam = TSS_Stream_Input then if Nam = TSS_Stream_Input then
return RTE (RE_Wide_Wide_String_Input); return RTE (RE_Wide_Wide_String_Input);
......
...@@ -92,17 +92,12 @@ package body System.Strings.Stream_Ops is ...@@ -92,17 +92,12 @@ package body System.Strings.Stream_Ops is
subtype String_Block is String_Type (1 .. C_In_Default_Block); subtype String_Block is String_Type (1 .. C_In_Default_Block);
-- Block IO is used in the following two scenarios: -- Block IO is used when the low level can support block IO and the size
-- of the character type is a multiple of the stream element type.
-- 1) When the size of the character type equals that of the stream
-- element type, regardless of endianness.
-- 2) When using the standard stream IO routines for elementary
-- types which guarantees the same endianness over partitions.
Use_Block_IO : constant Boolean := Use_Block_IO : constant Boolean :=
C_Size = SE_Size Stream_Attributes.Block_IO_OK
or else Stream_Attributes.Block_IO_OK; and then C_Size mod SE_Size = 0;
-- Conversions to and from Default_Block -- Conversions to and from Default_Block
......
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