[Ada] Sync wide Ada.String hashing units
authorPiotr Trojanek <trojanek@adacore.com>
Mon, 19 Oct 2020 14:23:31 +0000 (16:23 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 26 Nov 2020 08:39:52 +0000 (03:39 -0500)
gcc/ada/

* libgnat/a-stzhas.adb (Wide_Wide_Hash): Instantiate inside a
wrapper function.
* libgnat/a-stzhas.ads (Wide_Wide_Hash): Likewise; remove wrong
comment, because this is indeed a RM unit, as described in Ada
RM A.4.8 (1/3).

gcc/ada/libgnat/a-stzhas.adb
gcc/ada/libgnat/a-stzhas.ads

index 43abb8005999dea088ff95b530292f18a9cb4c79..c055de6f73abff526e14e54ba1825a02c0a2d523 100644 (file)
 --                                                                          --
 ------------------------------------------------------------------------------
 
---  This package does not require a body, since it is an instantiation. We
---  provide a dummy file containing a No_Body pragma so that previous versions
---  of the body (which did exist) will not interfere.
+with System.String_Hash;
 
-pragma No_Body;
+function Ada.Strings.Wide_Wide_Hash
+  (Key : Wide_Wide_String) return Containers.Hash_Type
+is
+   use Ada.Containers;
+   function Hash_Fun is new System.String_Hash.Hash
+     (Wide_Wide_Character, Wide_Wide_String, Hash_Type);
+begin
+   return Hash_Fun (Key);
+end Ada.Strings.Wide_Wide_Hash;
index 0c87672b520c24eea1c6ae8679a5c69266f88653..dea0ff14670a99f85303278456a04d51bfbce26a 100644 (file)
 --                                                                          --
 ------------------------------------------------------------------------------
 
---  Is this really an RM unit? Doc needed???
-
 with Ada.Containers;
-with System.String_Hash;
 
 function Ada.Strings.Wide_Wide_Hash
-is new System.String_Hash.Hash
-  (Wide_Wide_Character, Wide_Wide_String, Containers.Hash_Type);
+  (Key : Wide_Wide_String) return Containers.Hash_Type;
 
 pragma Pure (Ada.Strings.Wide_Wide_Hash);