summaryrefslogtreecommitdiff
path: root/Parser/pgen/grammar.py
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2019-10-15 08:26:12 +0100
committerGitHub <noreply@github.com>2019-10-15 08:26:12 +0100
commit0b60f64e4343913b4931dc27379d9808e5b78fe1 (patch)
tree197eeeff16c9146b5040bed69d1e0d95c5fdc87b /Parser/pgen/grammar.py
parent4d202281c128e2026e78fc5f4cc752b1dafbf3ad (diff)
downloadcpython-git-0b60f64e4343913b4931dc27379d9808e5b78fe1.tar.gz
bpo-11410: Standardize and use symbol visibility attributes across POSIX and Windows. (GH-16347)
Diffstat (limited to 'Parser/pgen/grammar.py')
-rw-r--r--Parser/pgen/grammar.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Parser/pgen/grammar.py b/Parser/pgen/grammar.py
index 56188db775..ce40e160ca 100644
--- a/Parser/pgen/grammar.py
+++ b/Parser/pgen/grammar.py
@@ -61,13 +61,14 @@ class Grammar:
def produce_graminit_c(self, writer):
writer("/* Generated by Parser/pgen */\n\n")
+ writer('#include "exports.h"\n')
writer('#include "grammar.h"\n')
- writer("grammar _PyParser_Grammar;\n")
+ writer("Py_EXPORTED_SYMBOL grammar _PyParser_Grammar;\n")
self.print_dfas(writer)
self.print_labels(writer)
- writer("grammar _PyParser_Grammar = {\n")
+ writer("Py_EXPORTED_SYMBOL grammar _PyParser_Grammar = {\n")
writer(" {n_dfas},\n".format(n_dfas=len(self.dfas)))
writer(" dfas,\n")
writer(" {{{n_labels}, labels}},\n".format(n_labels=len(self.labels)))