aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/libgnat/s-rannum.ads
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2020-06-12 18:24:52 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2020-07-27 04:05:15 -0400
commit1e29b5465e4d8dc30cea2ff2677294fbcecd0f21 (patch)
tree40a3eff789d5be98873ae445f04bcc19a828f6b7 /gcc/ada/libgnat/s-rannum.ads
parent7f5c0f328eced560a204bb8e3eae0d45795dd235 (diff)
downloadgcc-1e29b5465e4d8dc30cea2ff2677294fbcecd0f21.zip
gcc-1e29b5465e4d8dc30cea2ff2677294fbcecd0f21.tar.gz
gcc-1e29b5465e4d8dc30cea2ff2677294fbcecd0f21.tar.bz2
[Ada] Ada2020: AI12-0304 Put_Image attrs of lang-def types
gcc/ada/ * libgnat/s-rannum.ads, libgnat/s-rannum.adb: Add Put_Image. This will be inherited by the language-defined packages Ada.Numerics.Discrete_Random and Ada.Numerics.Float_Random. * libgnat/a-convec.ads, libgnat/a-convec.adb: Add Put_Image. * libgnat/s-putima.ads: Add pragma Preelaborate, so this can be imported into containers packages. * libgnat/s-putima.adb: Move Digit to private part; otherwise reference to Base is illegal in Preelaborate generic. * exp_put_image.adb (Build_Record_Put_Image_Procedure): Use the base type.
Diffstat (limited to 'gcc/ada/libgnat/s-rannum.ads')
-rw-r--r--gcc/ada/libgnat/s-rannum.ads7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ada/libgnat/s-rannum.ads b/gcc/ada/libgnat/s-rannum.ads
index ed2d35e..1851b69 100644
--- a/gcc/ada/libgnat/s-rannum.ads
+++ b/gcc/ada/libgnat/s-rannum.ads
@@ -57,6 +57,8 @@
with Interfaces;
+private with Ada.Strings.Text_Output;
+
package System.Random_Numbers with
SPARK_Mode => Off
is
@@ -142,7 +144,10 @@ private
-- Feedback distance from the current position
subtype State_Val is Interfaces.Unsigned_32;
- type State is array (0 .. N - 1) of State_Val;
+ type State is array (0 .. N - 1) of State_Val with Put_Image => Put_Image;
+
+ procedure Put_Image
+ (S : in out Ada.Strings.Text_Output.Sink'Class; V : State);
type Writable_Access (Self : access Generator) is limited null record;
-- Auxiliary type to make Generator a self-referential type