From: Nick Ing-Simmons Date: Mon, 20 Jan 2003 15:09:08 +0000 (+0000) Subject: Move #define printf out of perl.h into appropriate X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f2b1176c042dd0d792a0f916f759bd848210d4d8;p=p5sagit%2Fp5-mst-13.2.git Move #define printf out of perl.h into appropriate PerlIO files. p4raw-id: //depot/perlio@18520 --- diff --git a/fakesdio.h b/fakesdio.h index 8ef89e9..8be514f 100644 --- a/fakesdio.h +++ b/fakesdio.h @@ -55,6 +55,18 @@ #undef tmpfile #undef ungetc #undef vfprintf +#undef printf + +/* printf used to live in perl.h like this - more sophisticated + than the rest + */ +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && !defined(PERL_GCC_PEDANTIC) +#define printf(fmt,args...) PerlIO_stdoutf(fmt,##args) +#else +#define printf PerlIO_stdoutf +#endif +#endif + #define fprintf PerlIO_printf #define stdin PerlIO_stdin() #define stdout PerlIO_stdout() diff --git a/nostdio.h b/nostdio.h index ed51758..9726114 100644 --- a/nostdio.h +++ b/nostdio.h @@ -68,8 +68,10 @@ struct _FILE; #undef tmpfile #undef ungetc #undef vfprintf +#undef printf #define fprintf _CANNOT _fprintf_ +#define printf _CANNOT _printf_ #define stdin _CANNOT _stdin_ #define stdout _CANNOT _stdout_ #define stderr _CANNOT _stderr_ diff --git a/perl.h b/perl.h index 614d570..a3a6d10 100644 --- a/perl.h +++ b/perl.h @@ -3820,17 +3820,6 @@ typedef struct am_table_short AMTS; # define Atoul(s) Strtoul(s, (char **)NULL, 10) #endif -#if !defined(PERLIO_IS_STDIO) -/* - * Remap printf - */ -#undef printf -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && !defined(PERL_GCC_PEDANTIC) -#define printf(fmt,args...) PerlIO_stdoutf(fmt,##args) -#else -#define printf PerlIO_stdoutf -#endif -#endif /* if these never got defined, they need defaults */ #ifndef PERL_SET_CONTEXT