8000 gh-106316: Remove pytime.h header file by vstinner · Pull Request #106317 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-106316: Remove pytime.h header file #106317

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 1, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Really fix c-analyzer
  • Loading branch information
vstinner committed Jul 1, 2023
commit 46148d1967ec946fb4a1ab75904b6b8636d925bd
4 changes: 0 additions & 4 deletions Modules/socketmodule.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
/* Socket module header file */

#ifndef Py_BUILD_CORE_BUILTIN
# define Py_BUILD_CORE_MODULE 1
#endif

#include "pycore_time.h" // _PyTime_t

/* Includes needed for the sockaddr_* symbols below */
Expand Down
9 changes: 8 additions & 1 deletion Tools/c-analyzer/c_parser/preprocessor/gcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,21 @@ def preprocess(filename,
if not cwd or not os.path.isabs(cwd):
cwd = os.path.abspath(cwd or '.')
filename = _normpath(filename, cwd)

postargs = POST_ARGS
if os.path.basename(filename) == 'socketmodule.h':
# Modules/socketmodule.h uses pycore_time.h which needs Py_BUILD_CORE.
# Usually it's defined by the C file which includes it.
postargs += ('-DPy_BUILD_CORE=1',)

text = _common.preprocess(
TOOL,
filename,
incldirs=incldirs,
includes=includes,
macros=macros,
#preargs=PRE_ARGS,
postargs=POST_ARGS,
postargs=postargs,
executable=['gcc'],
compiler='unix',
cwd=cwd,
Expand Down
0