Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Modules/_ctypes/clinic/_ctypes.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Modules/_io/clinic/bufferedio.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Modules/_io/clinic/iobase.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Modules/_io/clinic/textio.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Modules/clinic/_curses_panel.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Modules/clinic/_dbmmodule.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Modules/clinic/_elementtree.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Modules/clinic/_gdbmmodule.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Modules/clinic/_pickle.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Modules/clinic/arraymodule.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Modules/clinic/pyexpat.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions Tools/clinic/libclinic/parse_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ def declare_parser(
p for p in f.parameters.values()
if not p.is_positional_only() and not p.is_vararg()
])

condition = '#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)'
if limited_capi:
declarations = """
#define KWTUPLE NULL
Expand All @@ -50,6 +52,9 @@ def declare_parser(
# define KWTUPLE NULL
#endif
"""

codegen.add_include('pycore_runtime.h', '_Py_SINGLETON()',
condition=condition)
else:
# XXX Why do we not statically allocate the tuple
# for non-builtin modules?
Expand All @@ -73,9 +78,10 @@ def declare_parser(
#endif // !Py_BUILD_CORE
""" % num_keywords

condition = '#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)'
codegen.add_include('pycore_gc.h', 'PyGC_Head', condition=condition)
codegen.add_include('pycore_runtime.h', '_Py_ID()', condition=condition)
codegen.add_include('pycore_gc.h', 'PyGC_Head',
condition=condition)
codegen.add_include('pycore_runtime.h', '_Py_ID()',
condition=condition)

declarations += """
static const char * const _keywords[] = {{{keywords_c} NULL}};
Expand Down