diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2019-10-15 07:26:12 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-15 07:26:12 (GMT) |
commit | 0b60f64e4343913b4931dc27379d9808e5b78fe1 (patch) | |
tree | 197eeeff16c9146b5040bed69d1e0d95c5fdc87b /Parser | |
parent | 4d202281c128e2026e78fc5f4cc752b1dafbf3ad (diff) | |
download | cpython-0b60f64e4343913b4931dc27379d9808e5b78fe1.zip cpython-0b60f64e4343913b4931dc27379d9808e5b78fe1.tar.gz cpython-0b60f64e4343913b4931dc27379d9808e5b78fe1.tar.bz2 |
bpo-11410: Standardize and use symbol visibility attributes across POSIX and Windows. (GH-16347)
Diffstat (limited to 'Parser')
-rw-r--r-- | Parser/pgen/grammar.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Parser/pgen/grammar.py b/Parser/pgen/grammar.py index 56188db..ce40e16 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))) |