Integrate change #9154 from maintperl to mainline.
Jarkko Hietaniemi [Wed, 14 Mar 2001 20:48:06 +0000 (20:48 +0000)]
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..)

embed.h
embed.pl
global.sym
globals.c
iperlsys.h
objXSUB.h
perlapi.c
proto.h

diff --git a/embed.h b/embed.h
index 44ff2fd..83afb92 100644 (file)
--- a/embed.h
+++ b/embed.h
 #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
 #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
index 4cd8aca..bd46b1c 100755 (executable)
--- 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
index 870fccf..49d4e85 100644 (file)
@@ -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
index 0782eba..5bf4aea 100644 (file)
--- 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 */
index fe03f5c..fdbd12a 100644 (file)
@@ -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)                                           \
index 7bba68a..cce7f6f 100644 (file)
--- a/objXSUB.h
+++ b/objXSUB.h
 #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
index 4f427e0..9de8725 100644 (file)
--- 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 (file)
--- 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);