summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-08-25 18:12:36 (GMT)
committerGuido van Rossum <guido@python.org>1998-08-25 18:12:36 (GMT)
commit47fbc4049e991f29b0a64cbb0449640b0b0353df (patch)
treed2a30196af5899c567ba1abf23dca7c5a4a5d27a /Parser
parentd0dc5b06a2e51f5b01a14cf1ce291467bb10cfb7 (diff)
downloadcpython-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')
-rw-r--r--Parser/pgenmain.c27
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);
+}