Skip to content

Commit

Permalink
PerlIO_stdoutf() wasn't properly supported under PERL_IMPLICIT_SYS
Browse files Browse the repository at this point in the history
(caused Storable 1.0.10 to break on windows)

p4raw-id: //depot/maint-5.6/perl@9154
  • Loading branch information
Gurusamy Sarathy committed Mar 14, 2001
1 parent 3a5bf45 commit 241ea07
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 1 deletion.
3 changes: 3 additions & 0 deletions embed.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,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
Expand Down Expand Up @@ -3140,6 +3141,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
Expand Down
11 changes: 11 additions & 0 deletions embed.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,16 @@ sub emit_func {
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 */
Expand Down Expand Up @@ -1440,6 +1450,7 @@ END
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
Expand Down
1 change: 1 addition & 0 deletions global.sym
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,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
Expand Down
9 changes: 9 additions & 0 deletions globals.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
2 changes: 1 addition & 1 deletion iperlsys.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ struct IPerlStdIOInfo
#define PerlIO_setlinebuf(f) \
(*PL_StdIO->pSetlinebuf)(PL_StdIO, (f))
#define PerlIO_printf Perl_fprintf_nocontext
#define PerlIO_stdoutf *PL_StdIO->pPrintf
#define PerlIO_stdoutf Perl_printf_nocontext
#define PerlIO_vprintf(f,fmt,a) \
(*PL_StdIO->pVprintf)(PL_StdIO, (f),(fmt),a)
#define PerlIO_tell(f) \
Expand Down
4 changes: 4 additions & 0 deletions objXSUB.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,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
Expand Down
12 changes: 12 additions & 0 deletions perlapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,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
Expand Down Expand Up @@ -4124,6 +4126,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 */
Expand Down
5 changes: 5 additions & 0 deletions proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,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);
Expand Down

0 comments on commit 241ea07

Please sign in to comment.