From 47fbc4049e991f29b0a64cbb0449640b0b0353df Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 25 Aug 1998 18:12:36 +0000 Subject: [PATCH] Add a version of PySys_WriteStderr() that writes to stderr, so we can use it in tokenizer.c. --- Parser/pgenmain.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Parser/pgenmain.c b/Parser/pgenmain.c index 9441e587ed0..72924854309 100644 --- a/Parser/pgenmain.c +++ b/Parser/pgenmain.c @@ -211,3 +211,30 @@ PyOS_Readline(prompt) p[n-1] = '\n'; return realloc(p, n+1); } + +#ifdef HAVE_STDARG_PROTOTYPES +#include +#else +#include +#endif + +void +#ifdef HAVE_STDARG_PROTOTYPES +PySys_WriteStderr(const char *format, ...) +#else +PySys_WriteStderr(va_alist) + va_dcl +#endif +{ + va_list va; + +#ifdef HAVE_STDARG_PROTOTYPES + va_start(va, format); +#else + char *format; + va_start(va); + format = va_arg(va, char *); +#endif + vfprintf(stderr, format, va); + va_end(va); +}