Change 16272 by jhi@alpha on 2002/04/29 20:14:39
Integrate perlio;
Adding Encode::* to .pm creates stash at compile time
which means we need a stronger check on Encode at boot time.
Affected files ...
.... //depot/perl/ext/PerlIO/encoding/encoding.pm#9 integrate
.... //depot/perl/ext/PerlIO/encoding/encoding.xs#12 integrate
Differences ...
==== //depot/perl/ext/PerlIO/encoding/encoding.pm#9 (text) ====
Index: perl/ext/PerlIO/encoding/encoding.pm
--- perl/ext/PerlIO/encoding/encoding.pm.~1~ Mon Apr 29 14:30:05 2002
+++ perl/ext/PerlIO/encoding/encoding.pm Mon Apr 29 14:30:05 2002
@@ -12,7 +12,7 @@
use XSLoader ();
XSLoader::load(__PACKAGE__, $VERSION);
-our $fallback = Encode::PERLQQ()|Encode::WARN_ON_ERR;
+our $fallback = Encode::PERLQQ()|Encode::WARN_ON_ERR();
1;
__END__
==== //depot/perl/ext/PerlIO/encoding/encoding.xs#12 (text) ====
Index: perl/ext/PerlIO/encoding/encoding.xs
--- perl/ext/PerlIO/encoding/encoding.xs.~1~ Mon Apr 29 14:30:05 2002
+++ perl/ext/PerlIO/encoding/encoding.xs Mon Apr 29 14:30:05 2002
@@ -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 @@
} 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 @@
*/
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 @@
SPAGAIN;
LEAVE;
}
-#ifdef PERLIO_LAYERS
PUSHMARK(sp);
PUTBACK;
if (call_pv(OUR_DEFAULT_FB, G_SCALAR) != 1) {
@@ -638,6 +638,7 @@
SPAGAIN;
sv_setsv(chk, POPs);
PUTBACK;
+#ifdef PERLIO_LAYERS
PerlIO_define_layer(aTHX_ &PerlIO_encode);
#endif
POPSTACK;
End of Patch.