From 648a733a79f35c49b3820ae8d8a223f33cf42ba7 Mon Sep 17 00:00:00 2001 From: AN Long Date: Wed, 23 Jul 2025 22:19:41 +0900 Subject: [PATCH 1/2] Rename lock.h to pylock.h --- Include/Python.h | 2 +- Include/cpython/{lock.h => pylock.h} | 0 Include/internal/pycore_lock.h | 2 +- Include/{lock.h => pylock.h} | 2 +- Makefile.pre.in | 4 ++-- PCbuild/pythoncore.vcxproj | 4 ++-- PCbuild/pythoncore.vcxproj.filters | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) rename Include/cpython/{lock.h => pylock.h} (100%) rename Include/{lock.h => pylock.h} (87%) diff --git a/Include/Python.h b/Include/Python.h index 19417df698c8e7..3f49b78947c9a6 100644 --- a/Include/Python.h +++ b/Include/Python.h @@ -68,7 +68,7 @@ #include "pybuffer.h" #include "pystats.h" #include "pyatomic.h" -#include "lock.h" +#include "pylock.h" #include "critical_section.h" #include "object.h" #include "refcount.h" diff --git a/Include/cpython/lock.h b/Include/cpython/pylock.h similarity index 100% rename from Include/cpython/lock.h rename to Include/cpython/pylock.h diff --git a/Include/internal/pycore_lock.h b/Include/internal/pycore_lock.h index 585120108cf342..c4e007e744ce0f 100644 --- a/Include/internal/pycore_lock.h +++ b/Include/internal/pycore_lock.h @@ -13,7 +13,7 @@ extern "C" { # error "this header requires Py_BUILD_CORE define" #endif -//_Py_UNLOCKED is defined as 0 and _Py_LOCKED as 1 in Include/cpython/lock.h +//_Py_UNLOCKED is defined as 0 and _Py_LOCKED as 1 in Include/cpython/pylock.h #define _Py_HAS_PARKED 2 #define _Py_ONCE_INITIALIZED 4 diff --git a/Include/lock.h b/Include/pylock.h similarity index 87% rename from Include/lock.h rename to Include/pylock.h index 782b9dbc70d056..1939ef269d3090 100644 --- a/Include/lock.h +++ b/Include/pylock.h @@ -6,7 +6,7 @@ extern "C" { #ifndef Py_LIMITED_API # define Py_CPYTHON_LOCK_H -# include "cpython/lock.h" +# include "cpython/pylock.h" # undef Py_CPYTHON_LOCK_H #endif diff --git a/Makefile.pre.in b/Makefile.pre.in index fa17f5d7bfc0ac..0c070131cda200 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1187,7 +1187,7 @@ PYTHON_HEADERS= \ $(srcdir)/Include/intrcheck.h \ $(srcdir)/Include/iterobject.h \ $(srcdir)/Include/listobject.h \ - $(srcdir)/Include/lock.h \ + $(srcdir)/Include/pylock.h \ $(srcdir)/Include/longobject.h \ $(srcdir)/Include/marshal.h \ $(srcdir)/Include/memoryobject.h \ @@ -1264,7 +1264,7 @@ PYTHON_HEADERS= \ $(srcdir)/Include/cpython/import.h \ $(srcdir)/Include/cpython/initconfig.h \ $(srcdir)/Include/cpython/listobject.h \ - $(srcdir)/Include/cpython/lock.h \ + $(srcdir)/Include/cpython/pylock.h \ $(srcdir)/Include/cpython/longintrepr.h \ $(srcdir)/Include/cpython/longobject.h \ $(srcdir)/Include/cpython/memoryobject.h \ diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index b911c9385634d7..517103acea8d8e 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -165,7 +165,7 @@ - + @@ -332,7 +332,7 @@ - + diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index 0e6d42cc959ba5..e9eedfd1312fae 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -120,7 +120,7 @@ Include - + Include @@ -414,7 +414,7 @@ Include\cpython - + Include From f2650801271bacf24caaec9ea69669151b85fee6 Mon Sep 17 00:00:00 2001 From: AN Long Date: Wed, 23 Jul 2025 22:30:50 +0900 Subject: [PATCH 2/2] Add news entry --- .../next/C_API/2025-07-23-22-30-23.gh-issue-136759.ffB4wO.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/C_API/2025-07-23-22-30-23.gh-issue-136759.ffB4wO.rst diff --git a/Misc/NEWS.d/next/C_API/2025-07-23-22-30-23.gh-issue-136759.ffB4wO.rst b/Misc/NEWS.d/next/C_API/2025-07-23-22-30-23.gh-issue-136759.ffB4wO.rst new file mode 100644 index 00000000000000..79819b4735ff17 --- /dev/null +++ b/Misc/NEWS.d/next/C_API/2025-07-23-22-30-23.gh-issue-136759.ffB4wO.rst @@ -0,0 +1 @@ +Rename ``lock.h`` to ``pylock.h`` to avoid potential include conflicts.