-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
WV : constant Unsigned_32 := Wide_Wide_Character'Pos (WC);
begin
if WV > 16#FFFF# then
- raise Constraint_Error with
- "out of range character for Value attribute";
+ Bad_Value (Str);
else
return Wide_Character'Val (WV);
end if;
-- Must be at least three characters
if L - F < 2 then
- raise Constraint_Error;
+ Bad_Value (Str);
-- If just three characters, simple character case
P := P + 1;
if P = Str'Last then
- raise Constraint_Error;
+ Bad_Value (Str);
end if;
return Str (P);
end if;
if P /= L - 1 then
- raise Constraint_Error;
+ Bad_Value (Str);
end if;
return W;
elsif Str (J) in 'a' .. 'f' then
W := W - Character'Pos ('a') + 10;
else
- raise Constraint_Error;
+ Bad_Value (Str);
end if;
end loop;
if W > 16#7FFF_FFFF# then
- raise Constraint_Error;
+ Bad_Value (Str);
else
return Wide_Wide_Character'Val (W);
end if;
exception
when Constraint_Error =>
- raise Constraint_Error with "invalid string for value attribute";
+ Bad_Value (Str);
end Value_Wide_Wide_Character;
end System.Val_WChar;