Skip to content

Commit 74503ac

Browse files
authored
[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 ec02db5)
1 parent 2880798 commit 74503ac

File tree

8 files changed

+10
-9
lines changed

8 files changed

+10
-9
lines changed

Include/Python.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
#include "pybuffer.h"
6969
#include "pystats.h"
7070
#include "pyatomic.h"
71-
#include "lock.h"
71+
#include "pylock.h"
7272
#include "object.h"
7373
#include "objimpl.h"
7474
#include "typeslots.h"
File renamed without changes.

Include/internal/pycore_lock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ extern "C" {
1313
# error "this header requires Py_BUILD_CORE define"
1414
#endif
1515

16-
//_Py_UNLOCKED is defined as 0 and _Py_LOCKED as 1 in Include/cpython/lock.h
16+
//_Py_UNLOCKED is defined as 0 and _Py_LOCKED as 1 in Include/cpython/pylock.h
1717
#define _Py_HAS_PARKED 2
1818
#define _Py_ONCE_INITIALIZED 4
1919

Include/lock.h renamed to Include/pylock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ extern "C" {
66

77
#ifndef Py_LIMITED_API
88
# define Py_CPYTHON_LOCK_H
9-
# include "cpython/lock.h"
9+
# include "cpython/pylock.h"
1010
# undef Py_CPYTHON_LOCK_H
1111
#endif
1212

Makefile.pre.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,7 @@ PYTHON_HEADERS= \
10391039
$(srcdir)/Include/intrcheck.h \
10401040
$(srcdir)/Include/iterobject.h \
10411041
$(srcdir)/Include/listobject.h \
1042-
$(srcdir)/Include/lock.h \
1042+
$(srcdir)/Include/pylock.h \
10431043
$(srcdir)/Include/longobject.h \
10441044
$(srcdir)/Include/marshal.h \
10451045
$(srcdir)/Include/memoryobject.h \
@@ -1113,7 +1113,7 @@ PYTHON_HEADERS= \
11131113
$(srcdir)/Include/cpython/import.h \
11141114
$(srcdir)/Include/cpython/initconfig.h \
11151115
$(srcdir)/Include/cpython/listobject.h \
1116-
$(srcdir)/Include/cpython/lock.h \
1116+
$(srcdir)/Include/cpython/pylock.h \
11171117
$(srcdir)/Include/cpython/longintrepr.h \
11181118
$(srcdir)/Include/cpython/longobject.h \
11191119
$(srcdir)/Include/cpython/memoryobject.h \
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Rename ``lock.h`` to ``pylock.h`` to avoid potential include conflicts.

PCbuild/pythoncore.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
<ClInclude Include="..\Include\cpython\import.h" />
159159
<ClInclude Include="..\Include\cpython\initconfig.h" />
160160
<ClInclude Include="..\Include\cpython\listobject.h" />
161-
<ClInclude Include="..\Include\cpython\lock.h" />
161+
<ClInclude Include="..\Include\cpython\pylock.h" />
162162
<ClInclude Include="..\Include\cpython\longintrepr.h" />
163163
<ClInclude Include="..\Include\cpython\longobject.h" />
164164
<ClInclude Include="..\Include\cpython\memoryobject.h" />
@@ -313,7 +313,7 @@
313313
<ClInclude Include="..\Include\intrcheck.h" />
314314
<ClInclude Include="..\Include\iterobject.h" />
315315
<ClInclude Include="..\Include\listobject.h" />
316-
<ClInclude Include="..\Include\lock.h" />
316+
<ClInclude Include="..\Include\pylock.h" />
317317
<ClInclude Include="..\Include\longobject.h" />
318318
<ClInclude Include="..\Include\marshal.h" />
319319
<ClInclude Include="..\Include\memoryobject.h" />

PCbuild/pythoncore.vcxproj.filters

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
<ClInclude Include="..\Include\listobject.h">
118118
<Filter>Include</Filter>
119119
</ClInclude>
120-
<ClInclude Include="..\Include\lock.h">
120+
<ClInclude Include="..\Include\pylock.h">
121121
<Filter>Include</Filter>
122122
</ClInclude>
123123
<ClInclude Include="..\Include\longobject.h">
@@ -402,7 +402,7 @@
402402
<ClInclude Include="..\Include\cpython\listobject.h">
403403
<Filter>Include\cpython</Filter>
404404
</ClInclude>
405-
<ClInclude Include="..\Include\cpython\lock.h">
405+
<ClInclude Include="..\Include\cpython\pylock.h">
406406
<Filter>Include</Filter>
407407
</ClInclude>
408408
<ClInclude Include="..\Include\cpython\longintrepr.h">

0 commit comments

Comments
 (0)