Skip to content

Commit ec02db5

Browse files
authored
gh-136759: rename lock.h to pylock.h (#137041)
Rename `lock.h` to `pylock.h` to avoid conflicts with headers of other projects.
1 parent ae4d27e commit ec02db5

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 "critical_section.h"
7373
#include "object.h"
7474
#include "refcount.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
@@ -1187,7 +1187,7 @@ PYTHON_HEADERS= \
11871187
$(srcdir)/Include/intrcheck.h \
11881188
$(srcdir)/Include/iterobject.h \
11891189
$(srcdir)/Include/listobject.h \
1190-
$(srcdir)/Include/lock.h \
1190+
$(srcdir)/Include/pylock.h \
11911191
$(srcdir)/Include/longobject.h \
11921192
$(srcdir)/Include/marshal.h \
11931193
$(srcdir)/Include/memoryobject.h \
@@ -1264,7 +1264,7 @@ PYTHON_HEADERS= \
12641264
$(srcdir)/Include/cpython/import.h \
12651265
$(srcdir)/Include/cpython/initconfig.h \
12661266
$(srcdir)/Include/cpython/listobject.h \
1267-
$(srcdir)/Include/cpython/lock.h \
1267+
$(srcdir)/Include/cpython/pylock.h \
12681268
$(srcdir)/Include/cpython/longintrepr.h \
12691269
$(srcdir)/Include/cpython/longobject.h \
12701270
$(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
@@ -165,7 +165,7 @@
165165
<ClInclude Include="..\Include\cpython\import.h" />
166166
<ClInclude Include="..\Include\cpython\initconfig.h" />
167167
<ClInclude Include="..\Include\cpython\listobject.h" />
168-
<ClInclude Include="..\Include\cpython\lock.h" />
168+
<ClInclude Include="..\Include\cpython\pylock.h" />
169169
<ClInclude Include="..\Include\cpython\longintrepr.h" />
170170
<ClInclude Include="..\Include\cpython\longobject.h" />
171171
<ClInclude Include="..\Include\cpython\memoryobject.h" />
@@ -332,7 +332,7 @@
332332
<ClInclude Include="..\Include\intrcheck.h" />
333333
<ClInclude Include="..\Include\iterobject.h" />
334334
<ClInclude Include="..\Include\listobject.h" />
335-
<ClInclude Include="..\Include\lock.h" />
335+
<ClInclude Include="..\Include\pylock.h" />
336336
<ClInclude Include="..\Include\longobject.h" />
337337
<ClInclude Include="..\Include\marshal.h" />
338338
<ClInclude Include="..\Include\memoryobject.h" />

PCbuild/pythoncore.vcxproj.filters

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
<ClInclude Include="..\Include\listobject.h">
121121
<Filter>Include</Filter>
122122
</ClInclude>
123-
<ClInclude Include="..\Include\lock.h">
123+
<ClInclude Include="..\Include\pylock.h">
124124
<Filter>Include</Filter>
125125
</ClInclude>
126126
<ClInclude Include="..\Include\longobject.h">
@@ -414,7 +414,7 @@
414414
<ClInclude Include="..\Include\cpython\listobject.h">
415415
<Filter>Include\cpython</Filter>
416416
</ClInclude>
417-
<ClInclude Include="..\Include\cpython\lock.h">
417+
<ClInclude Include="..\Include\cpython\pylock.h">
418418
<Filter>Include</Filter>
419419
</ClInclude>
420420
<ClInclude Include="..\Include\cpython\longintrepr.h">

0 commit comments

Comments
 (0)