This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Simplify Storable.xs by providing a fallback definition of HvTOTALKEYS().
authorNicholas Clark <nick@ccl4.org>
Tue, 13 Sep 2011 15:37:10 +0000 (17:37 +0200)
committerNicholas Clark <nick@ccl4.org>
Wed, 14 Sep 2011 09:49:38 +0000 (11:49 +0200)
Longer term this should be added to ppport.h

dist/Storable/Storable.xs

index 876a323..38e266d 100644 (file)
 #  define HvPLACEHOLDERS_get HvPLACEHOLDERS
 #endif
 
+#ifndef HvTOTALKEYS
+#  define HvTOTALKEYS(hv)      HvKEYS(hv)
+#endif
+
 #ifdef DEBUGME
 
 #ifndef DASSERT
@@ -2222,12 +2226,7 @@ sortcmp(const void *a, const void *b)
 static int store_hash(pTHX_ stcxt_t *cxt, HV *hv)
 {
        dVAR;
-       I32 len = 
-#ifdef HAS_RESTRICTED_HASHES
-            HvTOTALKEYS(hv);
-#else
-            HvKEYS(hv); /* Not HvUSEDKEYS, as 5.6 lacketh it */
-#endif
+       I32 len = HvTOTALKEYS(hv);
        I32 i;
        int ret = 0;
        I32 riter;