with Namet; use Namet;
with Nmake; use Nmake;
with Nlists; use Nlists;
+with Opt; use Opt;
with Rtsfind; use Rtsfind;
with Sem_Res; use Sem_Res;
with Sinfo; use Sinfo;
Make_Aggregate (Loc,
Expressions => Ind))),
Suppress => All_Checks);
-
end Build_Enumeration_Image_Tables;
----------------------------
-- For types whose root type is Wide_Character
-- xx = Wide_Character
-- tv = Wide_Character (Expr)
+ -- pm = Boolean, true if Ada 2005 mode, False otherwise
-- For types whose root type is Wide_Wide_Character
-- xx = Wide_Wide_haracter
Set_Conversion_OK (First (Arglist));
Set_Etype (First (Arglist), Tent);
+
+ -- For Wide_Character, append Ada 2005 indication
+
+ elsif Rtyp = Standard_Wide_Character then
+ Append_To (Arglist,
+ New_Reference_To (Boolean_Literals (Ada_Version >= Ada_05), Loc));
end if;
Rewrite (N,
--------------------------
function Image_Wide_Character
- (V : Wide_Character) return String
+ (V : Wide_Character;
+ Ada_2005 : Boolean) return String
is
begin
+ -- Annoying Ada 95 incompatibility with FFFE/FFFF
+
+ if V >= Wide_Character'Val (16#FFFE#)
+ and then not Ada_2005
+ then
+ if V = Wide_Character'Val (16#FFFE#) then
+ return "FFFE";
+ else
+ return "FFFF";
+ end if;
+ end if;
+
+ -- Normal case, same as Wide_Wide_Character
+
return
Image_Wide_Wide_Character
(Wide_Wide_Character'Val (Wide_Character'Pos (V)));
package System.Img_WChar is
pragma Pure;
- function Image_Wide_Character (V : Wide_Character) return String;
- -- Computes Wide_Character'Image (V) and returns the computed result
+ function Image_Wide_Character
+ (V : Wide_Character;
+ Ada_2005 : Boolean) return String;
+ -- Computes Wide_Character'Image (V) and returns the computed result. The
+ -- parameter Ada_2005 is True if operating in Ada 2005 mode (or beyond).
+ -- This is needed for the annoying FFFE/FFFF incompatibility.
function Image_Wide_Wide_Character (V : Wide_Wide_Character) return String;
-- Computes Wide_Wide_Character'Image (V) and returns the computed result