From: Gurusamy Sarathy Date: Mon, 11 Jun 2001 23:34:31 +0000 (-0700) Subject: As suggested in X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1de7c2aca01d9e33d916dcec3cd53be0b1f8e101;p=p5sagit%2Fp5-mst-13.2.git As suggested in Subject: Re: ext/ + -Wall Message-Id: <200106120634.f5C6YVM07246@smtp3.ActiveState.com> p4raw-id: //depot/perl@10535 --- diff --git a/ext/PerlIO/Scalar/Scalar.xs b/ext/PerlIO/Scalar/Scalar.xs index 9f991dd..49cb6e4 100644 --- a/ext/PerlIO/Scalar/Scalar.xs +++ b/ext/PerlIO/Scalar/Scalar.xs @@ -65,6 +65,7 @@ PerlIOScalar_popped(PerlIO *f) IV PerlIOScalar_close(PerlIO *f) { + dTHXs; IV code = PerlIOBase_close(f); PerlIOBase(f)->flags &= ~(PERLIO_F_RDBUF|PERLIO_F_WRBUF); return code; diff --git a/ext/PerlIO/Via/Via.xs b/ext/PerlIO/Via/Via.xs index b2c93ed..605774b 100644 --- a/ext/PerlIO/Via/Via.xs +++ b/ext/PerlIO/Via/Via.xs @@ -391,7 +391,7 @@ PerlIOVia_get_base(PerlIO *f) { if (PerlIOBase(f)->flags & PERLIO_F_CANREAD) { - dTHX; + dTHXs; PerlIOVia *s = PerlIOSelf(f,PerlIOVia); if (s->var) { @@ -409,6 +409,7 @@ PerlIOVia_get_ptr(PerlIO *f) PerlIOVia *s = PerlIOSelf(f,PerlIOVia); if (s->var) { + dTHXs; STDCHAR *p = (STDCHAR *)(SvEND(s->var) - s->cnt); return p; } diff --git a/globals.c b/globals.c index b442068..6368f28 100644 --- a/globals.c +++ b/globals.c @@ -73,6 +73,7 @@ CPerlObj::do_aspawn(void *vreally, void **vmark, void **vsp) int Perl_fprintf_nocontext(PerlIO *stream, const char *format, ...) { + dTHXs; va_list(arglist); va_start(arglist, format); return PerlIO_vprintf(stream, format, arglist); @@ -81,6 +82,7 @@ Perl_fprintf_nocontext(PerlIO *stream, const char *format, ...) int Perl_printf_nocontext(const char *format, ...) { + dTHXs; va_list(arglist); va_start(arglist, format); return PerlIO_vprintf(PerlIO_stdout(), format, arglist); diff --git a/perl.h b/perl.h index 092d6ef..1673da9 100644 --- a/perl.h +++ b/perl.h @@ -258,6 +258,15 @@ struct perl_thread; # define dTHXx dTHX #endif +/* Under PERL_IMPLICIT_SYS (used in Windows for fork emulation) + * PerlIO_foo() expands to PL_StdIO->pFOO(PL_StdIO, ...). + * dTHXs is therefore needed for all functions using PerlIO_foo(). */ +#ifdef PERL_IMPLICIT_SYS +# define dTHXs dTHX +#else +# define dTHXs dNOOP +#endif + #undef START_EXTERN_C #undef END_EXTERN_C #undef EXTERN_C