summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-09-30 17:25:54 (GMT)
committerGitHub <noreply@github.com>2023-09-30 17:25:54 (GMT)
commit74e425ec186dde6bcfb172616fe8f35ccb5a09bb (patch)
tree2c9167ef4bc17e11d2ada574f184949a8f53e5bc /Tools
parentf3bb00ea12db6525f07d62368a65efec47d192b9 (diff)
downloadcpython-74e425ec186dde6bcfb172616fe8f35ccb5a09bb.zip
cpython-74e425ec186dde6bcfb172616fe8f35ccb5a09bb.tar.gz
cpython-74e425ec186dde6bcfb172616fe8f35ccb5a09bb.tar.bz2
gh-110014: Fix _POSIX_THREADS and _POSIX_SEMAPHORES usage (#110139)
* pycore_pythread.h is now the central place to make sure that _POSIX_THREADS and _POSIX_SEMAPHORES macros are defined if available. * Make sure that pycore_pythread.h is included when _POSIX_THREADS and _POSIX_SEMAPHORES macros are tested. * PY_TIMEOUT_MAX is now defined as a constant, since its value depends on _POSIX_THREADS, instead of being defined as a macro. * Prevent integer overflow in the preprocessor when computing PY_TIMEOUT_MAX_VALUE on Windows: replace "0xFFFFFFFELL * 1000 < LLONG_MAX" with "0xFFFFFFFELL < LLONG_MAX / 1000". * Document the change and give hints how to fix affected code. * Add an exception for PY_TIMEOUT_MAX name to smelly.py * Add PY_TIMEOUT_MAX to the stable ABI
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/build/smelly.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Tools/build/smelly.py b/Tools/build/smelly.py
index 276a5ab..ab34530 100755
--- a/Tools/build/smelly.py
+++ b/Tools/build/smelly.py
@@ -11,6 +11,11 @@ ALLOWED_PREFIXES = ('Py', '_Py')
if sys.platform == 'darwin':
ALLOWED_PREFIXES += ('__Py',)
+# "Legacy": some old symbols are prefixed by "PY_".
+EXCEPTIONS = frozenset({
+ 'PY_TIMEOUT_MAX',
+})
+
IGNORED_EXTENSION = "_ctypes_test"
# Ignore constructor and destructor functions
IGNORED_SYMBOLS = {'_init', '_fini'}
@@ -72,7 +77,7 @@ def get_smelly_symbols(stdout):
symbol = parts[-1]
result = '%s (type: %s)' % (symbol, symtype)
- if symbol.startswith(ALLOWED_PREFIXES):
+ if symbol.startswith(ALLOWED_PREFIXES) or symbol in EXCEPTIONS:
python_symbols.append(result)
continue