]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-136759: rename `lock.h` to `pylock.h` (#137041)
authorAN Long <aisk@users.noreply.github.com>
Thu, 24 Jul 2025 10:46:07 +0000 (19:46 +0900)
committerGitHub <noreply@github.com>
Thu, 24 Jul 2025 10:46:07 +0000 (16:16 +0530)
Rename `lock.h` to `pylock.h` to avoid conflicts with headers of other projects.

Include/Python.h
Include/cpython/pylock.h [moved from Include/cpython/lock.h with 100% similarity]
Include/internal/pycore_lock.h
Include/pylock.h [moved from Include/lock.h with 87% similarity]
Makefile.pre.in
Misc/NEWS.d/next/C_API/2025-07-23-22-30-23.gh-issue-136759.ffB4wO.rst [new file with mode: 0644]
PCbuild/pythoncore.vcxproj
PCbuild/pythoncore.vcxproj.filters

index 19417df698c8e759680c1e4d91058a3708e5336f..3f49b78947c9a633245472c4acda66e6a20aa815 100644 (file)
@@ -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"
index 585120108cf342e00f2c3b611cc9ead69dd5ae41..c4e007e744ce0f72683aa6e5c844af56fc9599e6 100644 (file)
@@ -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
 
similarity index 87%
rename from Include/lock.h
rename to Include/pylock.h
index 782b9dbc70d056994c6bbd90d6a5606ef57369d2..1939ef269d3090609c2d0d049bd32c90a6171287 100644 (file)
@@ -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
 
index fa17f5d7bfc0ac2090fcae6119e616e70717aba8..0c070131cda20005c812bbcb8507765a84415328 100644 (file)
@@ -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/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 (file)
index 0000000..79819b4
--- /dev/null
@@ -0,0 +1 @@
+Rename ``lock.h`` to ``pylock.h`` to avoid potential include conflicts.
index b911c9385634d77624cccfeb3728c1da95fa08fc..517103acea8d8e83f495c248ec175e6340b6910a 100644 (file)
     <ClInclude Include="..\Include\cpython\import.h" />
     <ClInclude Include="..\Include\cpython\initconfig.h" />
     <ClInclude Include="..\Include\cpython\listobject.h" />
-    <ClInclude Include="..\Include\cpython\lock.h" />
+    <ClInclude Include="..\Include\cpython\pylock.h" />
     <ClInclude Include="..\Include\cpython\longintrepr.h" />
     <ClInclude Include="..\Include\cpython\longobject.h" />
     <ClInclude Include="..\Include\cpython\memoryobject.h" />
     <ClInclude Include="..\Include\intrcheck.h" />
     <ClInclude Include="..\Include\iterobject.h" />
     <ClInclude Include="..\Include\listobject.h" />
-    <ClInclude Include="..\Include\lock.h" />
+    <ClInclude Include="..\Include\pylock.h" />
     <ClInclude Include="..\Include\longobject.h" />
     <ClInclude Include="..\Include\marshal.h" />
     <ClInclude Include="..\Include\memoryobject.h" />
index 0e6d42cc959ba5643d240ebbbe2c041adbc1b4de..e9eedfd1312fae109b2858addc7af1e630c3094e 100644 (file)
     <ClInclude Include="..\Include\listobject.h">
       <Filter>Include</Filter>
     </ClInclude>
-    <ClInclude Include="..\Include\lock.h">
+    <ClInclude Include="..\Include\pylock.h">
       <Filter>Include</Filter>
     </ClInclude>
     <ClInclude Include="..\Include\longobject.h">
     <ClInclude Include="..\Include\cpython\listobject.h">
       <Filter>Include\cpython</Filter>
     </ClInclude>
-    <ClInclude Include="..\Include\cpython\lock.h">
+    <ClInclude Include="..\Include\cpython\pylock.h">
       <Filter>Include</Filter>
     </ClInclude>
     <ClInclude Include="..\Include\cpython\longintrepr.h">