From: Jarkko Hietaniemi Date: Wed, 14 Mar 2001 20:48:06 +0000 (+0000) Subject: Integrate change #9154 from maintperl to mainline. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b0316773a7479486204b0422c55f41a957e6f99b;p=p5sagit%2Fp5-mst-13.2.git Integrate change #9154 from maintperl to mainline. PerlIO_stdoutf() wasn't properly supported under PERL_IMPLICIT_SYS (caused Storable 1.0.10 to break on windows) p4raw-link: @9154 on //depot/maint-5.6/perl: 241ea079897f140daac27d059c9935e78ec152ec p4raw-id: //depot/perl@9156 p4raw-integrated: from //depot/maint-5.6/perl@9155 'copy in' globals.c (@5902..) 'merge in' global.sym (@8599..) iperlsys.h (@8800..) objXSUB.h perlapi.c (@8993..) embed.h embed.pl proto.h (@9108..) --- diff --git a/embed.h b/embed.h index 44ff2fd..83afb92 100644 --- a/embed.h +++ b/embed.h @@ -131,6 +131,7 @@ #define sv_catpvf_mg_nocontext Perl_sv_catpvf_mg_nocontext #define sv_setpvf_mg_nocontext Perl_sv_setpvf_mg_nocontext #define fprintf_nocontext Perl_fprintf_nocontext +#define printf_nocontext Perl_printf_nocontext #endif #define cv_ckproto Perl_cv_ckproto #define cv_clone Perl_cv_clone @@ -3188,6 +3189,8 @@ #define sv_setpvf_mg_nocontext Perl_sv_setpvf_mg_nocontext #define Perl_fprintf_nocontext CPerlObj::Perl_fprintf_nocontext #define fprintf_nocontext Perl_fprintf_nocontext +#define Perl_printf_nocontext CPerlObj::Perl_printf_nocontext +#define printf_nocontext Perl_printf_nocontext #endif #define Perl_cv_ckproto CPerlObj::Perl_cv_ckproto #define cv_ckproto Perl_cv_ckproto diff --git a/embed.pl b/embed.pl index 4cd8aca..bd46b1c 100755 --- a/embed.pl +++ b/embed.pl @@ -1073,6 +1073,16 @@ Perl_fprintf_nocontext(PerlIO *stream, const char *format, ...) return (*PL_StdIO->pVprintf)(PL_StdIO, stream, format, arglist); } +#undef Perl_printf_nocontext +int +Perl_printf_nocontext(const char *format, ...) +{ + dTHXo; + va_list(arglist); + va_start(arglist, format); + return (*PL_StdIO->pVprintf)(PL_StdIO, PerlIO_stdout(), format, arglist); +} + END_EXTERN_C #endif /* PERL_OBJECT */ @@ -1445,6 +1455,7 @@ Afnp |void |sv_setpvf_nocontext|SV* sv|const char* pat|... Afnp |void |sv_catpvf_mg_nocontext|SV* sv|const char* pat|... Afnp |void |sv_setpvf_mg_nocontext|SV* sv|const char* pat|... Afnp |int |fprintf_nocontext|PerlIO* stream|const char* fmt|... +Afnp |int |printf_nocontext|const char* fmt|... #endif p |void |cv_ckproto |CV* cv|GV* gv|char* p p |CV* |cv_clone |CV* proto diff --git a/global.sym b/global.sym index 870fccf..49d4e85 100644 --- a/global.sym +++ b/global.sym @@ -68,6 +68,7 @@ Perl_sv_setpvf_nocontext Perl_sv_catpvf_mg_nocontext Perl_sv_setpvf_mg_nocontext Perl_fprintf_nocontext +Perl_printf_nocontext Perl_cv_const_sv Perl_cv_undef Perl_cx_dump diff --git a/globals.c b/globals.c index 0782eba..5bf4aea 100644 --- a/globals.c +++ b/globals.c @@ -79,4 +79,13 @@ Perl_fprintf_nocontext(PerlIO *stream, const char *format, ...) return PerlIO_vprintf(stream, format, arglist); } +int +Perl_printf_nocontext(const char *format, ...) +{ + dTHX; + va_list(arglist); + va_start(arglist, format); + return PerlIO_vprintf(PerlIO_stdout(), format, arglist); +} + #include "perlapi.h" /* bring in PL_force_link_funcs */ diff --git a/iperlsys.h b/iperlsys.h index fe03f5c..fdbd12a 100644 --- a/iperlsys.h +++ b/iperlsys.h @@ -251,9 +251,9 @@ struct IPerlStdIOInfo #define PerlSIO_setlinebuf(f) \ (*PL_StdIO->pSetlinebuf)(PL_StdIO, (f)) #define PerlSIO_printf Perl_fprintf_nocontext -#define PerlSIO_stdoutf *PL_StdIO->pPrintf -#define PerlSIO_vprintf(f,fmt,a) \ - (*PL_StdIO->pVprintf)(PL_StdIO, (f),(fmt),a) +#define PerlSIO_stdoutf Perl_printf_nocontext +#define PerlSIO_vprintf(f,fmt,a) \ + (*PL_StdIO->pVprintf)(PL_StdIO, (f),(fmt),a) #define PerlSIO_ftell(f) \ (*PL_StdIO->pTell)(PL_StdIO, (f)) #define PerlSIO_fseek(f,o,w) \ diff --git a/objXSUB.h b/objXSUB.h index 7bba68a..cce7f6f 100644 --- a/objXSUB.h +++ b/objXSUB.h @@ -228,6 +228,10 @@ #define Perl_fprintf_nocontext pPerl->Perl_fprintf_nocontext #undef fprintf_nocontext #define fprintf_nocontext Perl_fprintf_nocontext +#undef Perl_printf_nocontext +#define Perl_printf_nocontext pPerl->Perl_printf_nocontext +#undef printf_nocontext +#define printf_nocontext Perl_printf_nocontext #endif #undef Perl_cv_const_sv #define Perl_cv_const_sv pPerl->Perl_cv_const_sv diff --git a/perlapi.c b/perlapi.c index 4f427e0..9de8725 100644 --- a/perlapi.c +++ b/perlapi.c @@ -480,6 +480,8 @@ Perl_sv_setpvf_mg_nocontext(SV* sv, const char* pat, ...) } #undef Perl_fprintf_nocontext + +#undef Perl_printf_nocontext #endif #undef Perl_cv_const_sv @@ -4199,6 +4201,16 @@ Perl_fprintf_nocontext(PerlIO *stream, const char *format, ...) return (*PL_StdIO->pVprintf)(PL_StdIO, stream, format, arglist); } +#undef Perl_printf_nocontext +int +Perl_printf_nocontext(const char *format, ...) +{ + dTHXo; + va_list(arglist); + va_start(arglist, format); + return (*PL_StdIO->pVprintf)(PL_StdIO, PerlIO_stdout(), format, arglist); +} + END_EXTERN_C #endif /* PERL_OBJECT */ diff --git a/proto.h b/proto.h index 4e8abe0..1201e64 100644 --- a/proto.h +++ b/proto.h @@ -177,6 +177,11 @@ PERL_CALLCONV int Perl_fprintf_nocontext(PerlIO* stream, const char* fmt, ...) __attribute__((format(printf,2,3))) #endif ; +PERL_CALLCONV int Perl_printf_nocontext(const char* fmt, ...) +#ifdef CHECK_FORMAT + __attribute__((format(printf,1,2))) +#endif +; #endif PERL_CALLCONV void Perl_cv_ckproto(pTHX_ CV* cv, GV* gv, char* p); PERL_CALLCONV CV* Perl_cv_clone(pTHX_ CV* proto);