diff Python/compile.c @ 5438:e926c331ebbf legacy-trunk

Instead of importing graminit.h whenever one of the three grammar 'root' symbols is needed, define these in Python.h with a Py_ prefix.
author Guido van Rossum <guido@python.org>
date Wed, 07 May 1997 17:46:13 +0000
parents 5880384d7c71
children 9c6c07d449df
line wrap: on
line diff
--- a/Python/compile.c	Wed May 07 17:42:41 1997 +0000
+++ b/Python/compile.c	Wed May 07 17:46:13 1997 +0000
@@ -58,6 +58,20 @@
 
 #include <ctype.h>
 
+/* Three symbols from graminit.h are also defined in Python.h, with
+   Py_ prefixes to their names.  Python.h can't include graminit.h
+   (which defines too many confusing symbols), but we can check here
+   that they haven't changed (which is very unlikely, but possible). */
+#if Py_single_input != single_input
+#error "single_input has changed -- update Py_single_input in Python.h"
+#endif
+#if Py_file_input != file_input
+#error "file_input has changed -- update Py_file_input in Python.h"
+#endif
+#if Py_eval_input != eval_input
+#error "eval_input has changed -- update Py_eval_input in Python.h"
+#endif
+
 int Py_OptimizeFlag = 0;
 
 #define OP_DELETE 0