On Wednesday, May 22, 2002, at 01:04 AM, Nick Ing-Simmons wrote:
> Excellent! - We have eliminated Encode and PerlIO::encoding as causes
> as they are still present in the above. We have also eliminated VMS
> file-system weirdness as that is still there too.
So darn glad to hear that. Thanks so much for the time you guys have
spent.
> We also have a quick-fix for 5.8 if you agree to it - lie about stdio's
> buffer snooping ability in "configure" so that perlio.c will choose
> :perlio as the default layer for implementation.
>
> The finger now points at VMS specific "stdio" hackery which the :stdio
> layer is using. As that has probably been merged by several people -
> me who did not understand VMS C library and some VMS folk who did
> not understand perlio.c - and as the whole thing is wrapped in a
> horrible
> include file and #define forest a bug in there is quite likely.
>
> I would be tempted to make a vms_ungetc() _function_ which incorporated
> the current macro, point iperlsys.h at that rather than the macro
> and add some debug to prove it was getting called
> and to log what the vms_problem.t 'ungets' and what state the ptr etc.
> are in when it does it.
>
> (If there are other VMS-isms which are macros the same technique can
> be used.)
>
> Then perhaps we can come up with a non-Encode test which reproduces the
> problem.
Another possible quick fix would be alternate buffering scheme. As you
know Encode::XS does not use line buffering unconditionally
($e->needs_lines is always false). We can make it so that
$e->needs_lines returns 1 for VMS.
Craig, if you got time would you please try the patch below? CAVEAT
P5P: THIS IS FOR VMS ONLY. DO NOT TRY THIS UNLESS YOU ARE ON VMS.
--- Encode.xs 2002/05/20 15:25:44 1.46
+++ Encode.xs 2002/05/21 16:18:48
@@ -1,5 +1,5 @@
/*
- $Id: Encode.xs,v 1.46 2002/05/20 15:25:44 dankogai Exp dankogai $
+ $Id: Encode.xs,v 1.46 2002/05/20 15:25:44 dankogai Exp $
*/
#define PERL_NO_GET_CONTEXT
@@ -284,7 +284,8 @@
CODE:
{
/* encode_t *enc = INT2PTR(encode_t *, SvIV(SvRV(obj))); */
- ST(0) = &PL_sv_no;
+ /* ST(0) = &PL_sv_no; */
+ ST(0) = &PL_sv_yes;
XSRETURN(1);
}
Even if it works, I do not consider this to be a radical cure. But a
cure nonetheless....
BTW, what is the most concise way to check the architecture FROM XS?
Dan the Encode Maintainer