diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 2002-04-29 17:33:38 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2002-04-29 17:33:38 +0000 |
commit | dc54c7994351acc5ef5bb312ef93ea76de59c190 (patch) | |
tree | 75f0cc97df5d3be61156631790b38d40b81b884f /ext/PerlIO | |
parent | 17e5a7de8cce0cb2e0647c9de99f155cf86e2861 (diff) | |
download | perl-dc54c7994351acc5ef5bb312ef93ea76de59c190.tar.gz |
Adding Encode::* to .pm creates stash at compile time
which means we need a stronger check on Encode at boot time.
p4raw-id: //depot/perlio@16270
Diffstat (limited to 'ext/PerlIO')
-rw-r--r-- | ext/PerlIO/encoding/encoding.pm | 2 | ||||
-rw-r--r-- | ext/PerlIO/encoding/encoding.xs | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/ext/PerlIO/encoding/encoding.pm b/ext/PerlIO/encoding/encoding.pm index 327baeb1ae..16a629c6fa 100644 --- a/ext/PerlIO/encoding/encoding.pm +++ b/ext/PerlIO/encoding/encoding.pm @@ -12,7 +12,7 @@ $DEBUG and warn __PACKAGE__, " called by ", join(", ", caller), "\n"; use XSLoader (); XSLoader::load(__PACKAGE__, $VERSION); -our $fallback = Encode::PERLQQ()|Encode::WARN_ON_ERR; +our $fallback = Encode::PERLQQ()|Encode::WARN_ON_ERR(); 1; __END__ diff --git a/ext/PerlIO/encoding/encoding.xs b/ext/PerlIO/encoding/encoding.xs index 0a6ab1050f..038dd92861 100644 --- a/ext/PerlIO/encoding/encoding.xs +++ b/ext/PerlIO/encoding/encoding.xs @@ -8,6 +8,8 @@ #include "XSUB.h" #define U8 U8 +#define OUR_DEFAULT_FB "Encode::PERLQQ" + #if defined(USE_PERLIO) && !defined(USE_SFIO) /* Define an encoding "layer" in the perliol.h sense. @@ -49,7 +51,6 @@ typedef struct { } PerlIOEncode; #define NEEDS_LINES 1 -#define OUR_DEFAULT_FB "Encode::PERLQQ" SV * PerlIOEncode_getarg(pTHX_ PerlIO * f, CLONE_PARAMS * param, int flags) @@ -615,7 +616,7 @@ BOOT: */ PUSHSTACKi(PERLSI_MAGIC); SPAGAIN; - if (!gv_stashpvn("Encode", 6, FALSE)) { + if (!get_cv(OUR_DEFAULT_FB, 0)) { #if 0 /* This would just be an irritant now loading works */ Perl_warner(aTHX_ packWARN(WARN_IO), ":encoding without 'use Encode'"); @@ -628,7 +629,6 @@ BOOT: SPAGAIN; LEAVE; } -#ifdef PERLIO_LAYERS PUSHMARK(sp); PUTBACK; if (call_pv(OUR_DEFAULT_FB, G_SCALAR) != 1) { @@ -638,6 +638,7 @@ BOOT: SPAGAIN; sv_setsv(chk, POPs); PUTBACK; +#ifdef PERLIO_LAYERS PerlIO_define_layer(aTHX_ &PerlIO_encode); #endif POPSTACK; |