(Typ : Entity_Id;
Nam : TSS_Name_Type) return Entity_Id
is
- Ent : constant Entity_Id := TSS (Typ, Nam);
+ Base_Typ : constant Entity_Id := Base_Type (Typ);
+ Ent : constant Entity_Id := TSS (Typ, Nam);
begin
if Present (Ent) then
-- String as defined in package Ada
- if Typ = Standard_String then
+ if Base_Typ = Standard_String then
if Nam = TSS_Stream_Input then
return RTE (RE_String_Input);
-- 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
return RTE (RE_Wide_String_Input);
-- 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
return RTE (RE_Wide_Wide_String_Input);
subtype String_Block is String_Type (1 .. C_In_Default_Block);
- -- Block IO is used in the following two scenarios:
-
- -- 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.
+ -- 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.
Use_Block_IO : constant Boolean :=
- C_Size = SE_Size
- or else Stream_Attributes.Block_IO_OK;
+ Stream_Attributes.Block_IO_OK
+ and then C_Size mod SE_Size = 0;
-- Conversions to and from Default_Block