diff options
author | Guido van Rossum <guido@python.org> | 1998-08-25 18:12:36 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1998-08-25 18:12:36 (GMT) |
commit | 47fbc4049e991f29b0a64cbb0449640b0b0353df (patch) | |
tree | d2a30196af5899c567ba1abf23dca7c5a4a5d27a /Parser/pgenmain.c | |
parent | d0dc5b06a2e51f5b01a14cf1ce291467bb10cfb7 (diff) | |
download | cpython-47fbc4049e991f29b0a64cbb0449640b0b0353df.zip cpython-47fbc4049e991f29b0a64cbb0449640b0b0353df.tar.gz cpython-47fbc4049e991f29b0a64cbb0449640b0b0353df.tar.bz2 |
Add a version of PySys_WriteStderr() that writes to stderr, so we can
use it in tokenizer.c.
Diffstat (limited to 'Parser/pgenmain.c')
-rw-r--r-- | Parser/pgenmain.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Parser/pgenmain.c b/Parser/pgenmain.c index 9441e58..7292485 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 <stdarg.h> +#else +#include <varargs.h> +#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); +} |