From: AN Long Date: Thu, 24 Jul 2025 16:06:25 +0000 (+0900) Subject: [3.13] gh-136759: rename `lock.h` to `pylock.h` (GH-137041) (#137075) X-Git-Tag: v3.13.6~47 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=74503acba7d6c563aeef307ccf2d0cee141838b0;p=thirdparty%2FPython%2Fcpython.git [3.13] gh-136759: rename `lock.h` to `pylock.h` (GH-137041) (#137075) Rename `lock.h` to `pylock.h` to avoid conflicts with headers of other projects. (cherry picked from commit ec02db5caa546cb4759999453bd6efc1d517b95c) --- diff --git a/Include/Python.h b/Include/Python.h index fb2d32d71104..77c291e5d9f4 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 "object.h" #include "objimpl.h" #include "typeslots.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 2a18bb764472..b4ef9caf55e2 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 782b9dbc70d0..1939ef269d30 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 70d549589ed3..a6a6a5a556d0 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1039,7 +1039,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 \ @@ -1113,7 +1113,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 index 000000000000..79819b4735ff --- /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. diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index 70212903c837..e0717e336f9f 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -158,7 +158,7 @@ - + @@ -313,7 +313,7 @@ - + diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index 3eed5a9465bc..9d4651d8fbd9 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -117,7 +117,7 @@ Include - + Include @@ -402,7 +402,7 @@ Include\cpython - + Include