summaryrefslogtreecommitdiff
path: root/dist
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2021-05-25 05:21:37 +0000
committerNicholas Clark <nick@ccl4.org>2021-08-30 07:40:21 +0000
commitb0f6d4d8b03499558cd25690c336741dd3d52d9a (patch)
treecf9c5cbc97f31e3833d1e15e43fd489be6607f8a /dist
parenta86a81d3b9752ed84fa565382477cecf2a468406 (diff)
downloadperl-b0f6d4d8b03499558cd25690c336741dd3d52d9a.tar.gz
Remove code in Storable that isn't actually needed for v5.6.1 or later.
The definitions inside USE_PERLIO,PERLIO_IS_STDIO are for pre-5.004 HvSHAREKEYS_off has been defined since 5.004 SvUTF8_on has been defined since v5.6.0 bytes_from_utf8 is defined since v5.6.1 (so the linker will be happy) (but SvUTF8(key) will always be false prior to v5.8.0, so we now generate some unreachable code for v5.6.1 and v5.6.2. Probably zero users of this.)
Diffstat (limited to 'dist')
-rw-r--r--dist/Storable/Storable.xs31
1 files changed, 0 insertions, 31 deletions
diff --git a/dist/Storable/Storable.xs b/dist/Storable/Storable.xs
index 12d29f2585..c7b4a8733c 100644
--- a/dist/Storable/Storable.xs
+++ b/dist/Storable/Storable.xs
@@ -35,28 +35,9 @@
#endif
/*
- * Pre PerlIO time when none of USE_PERLIO and PERLIO_IS_STDIO is defined
- * Provide them with the necessary defines so they can build with pre-5.004.
- */
-#ifndef USE_PERLIO
-#ifndef PERLIO_IS_STDIO
-#define PerlIO FILE
-#define PerlIO_getc(x) getc(x)
-#define PerlIO_putc(f,x) putc(x,f)
-#define PerlIO_read(x,y,z) fread(y,1,z,x)
-#define PerlIO_write(x,y,z) fwrite(y,1,z,x)
-#define PerlIO_stdoutf printf
-#endif /* PERLIO_IS_STDIO */
-#endif /* USE_PERLIO */
-
-/*
* Earlier versions of perl might be used, we can't assume they have the latest!
*/
-#ifndef HvSHAREKEYS_off
-#define HvSHAREKEYS_off(hv) /* Ignore */
-#endif
-
/* perl <= 5.8.2 needs this */
#ifndef SvIsCOW
# define SvIsCOW(sv) 0
@@ -304,7 +285,6 @@ typedef STRLEN ntag_t;
* Conditional UTF8 support.
*
*/
-#ifdef SvUTF8_on
#define STORE_UTF8STR(pv, len) STORE_PV_LEN(pv, len, SX_UTF8STR, SX_LUTF8STR)
#define HAS_UTF8_SCALARS
#ifdef HeKUTF8
@@ -313,10 +293,6 @@ typedef STRLEN ntag_t;
#else
/* 5.6 perl has utf8 scalars but not hashes */
#endif
-#else
-#define SvUTF8(sv) 0
-#define STORE_UTF8STR(pv, len) CROAK(("panic: storing UTF8 in non-UTF8 perl"))
-#endif
#ifndef HAS_UTF8_ALL
#define UTF8_CROAK() CROAK(("Cannot retrieve UTF8 data in non-UTF8 perl"))
#endif
@@ -2973,12 +2949,6 @@ static int store_hash(pTHX_ stcxt_t *cxt, HV *hv)
keyval = SvPV(key, keylen_tmp);
keylen = keylen_tmp;
-#ifdef HAS_UTF8_HASHES
- /* If you build without optimisation on pre 5.6
- then nothing spots that SvUTF8(key) is always 0,
- so the block isn't optimised away, at which point
- the linker dislikes the reference to
- bytes_from_utf8. */
if (SvUTF8(key)) {
const char *keysave = keyval;
bool is_utf8 = TRUE;
@@ -3003,7 +2973,6 @@ static int store_hash(pTHX_ stcxt_t *cxt, HV *hv)
flags |= SHV_K_UTF8;
}
}
-#endif
if (flagged_hash) {
PUTMARK(flags);