]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-79315: Remove Include/pylock.h and Include/monitoring.h (#139731)
authorVictor Stinner <vstinner@python.org>
Tue, 7 Oct 2025 22:49:24 +0000 (00:49 +0200)
committerGitHub <noreply@github.com>
Tue, 7 Oct 2025 22:49:24 +0000 (00:49 +0200)
Keep Include/cpython/pylock.h and Include/cpython/monitoring.h.

Include/Python.h
Include/cpython/monitoring.h
Include/cpython/pylock.h
Include/monitoring.h [deleted file]
Include/pylock.h [deleted file]
Makefile.pre.in
Modules/_testcapi/monitoring.c
PCbuild/pythoncore.vcxproj
PCbuild/pythoncore.vcxproj.filters

index 261b4d316bdf85880918360349c7127cef03b4b1..78083bbf31db751926a58f96ddfc3fa07114f3a6 100644 (file)
@@ -78,7 +78,7 @@ __pragma(warning(disable: 4201))
 #include "pybuffer.h"
 #include "pystats.h"
 #include "pyatomic.h"
-#include "pylock.h"
+#include "cpython/pylock.h"
 #include "critical_section.h"
 #include "object.h"
 #include "refcount.h"
@@ -105,7 +105,7 @@ __pragma(warning(disable: 4201))
 #include "setobject.h"
 #include "methodobject.h"
 #include "moduleobject.h"
-#include "monitoring.h"
+#include "cpython/monitoring.h"
 #include "cpython/funcobject.h"
 #include "cpython/classobject.h"
 #include "fileobject.h"
index ce92942404c9f7db3f9bf0378c1fa6d500ccf7bc..5094c8c23ae32bb628965105ba77ab2c7df92f05 100644 (file)
@@ -1,7 +1,13 @@
-#ifndef Py_CPYTHON_MONITORING_H
-#  error "this header file must not be included directly"
+#ifndef Py_MONITORING_H
+#define Py_MONITORING_H
+#ifndef Py_LIMITED_API
+#ifdef __cplusplus
+extern "C" {
 #endif
 
+// There is currently no limited API for monitoring
+
+
 /* Local events.
  * These require bytecode instrumentation */
 
@@ -267,3 +273,9 @@ PyMonitoring_FireStopIterationEvent(PyMonitoringState *state, PyObject *codelike
 }
 
 #undef _PYMONITORING_IF_ACTIVE
+
+#ifdef __cplusplus
+}
+#endif
+#endif  // !Py_LIMITED_API
+#endif  // !Py_MONITORING_H
index 63886fca28eae24ac903a5267ffd03c8d2e469b7..460ac2c9f80e81bdcb2d2c73a727f2d63592ddd7 100644 (file)
@@ -1,7 +1,11 @@
-#ifndef Py_CPYTHON_LOCK_H
-#  error "this header file must not be included directly"
+#ifndef Py_LOCK_H
+#define Py_LOCK_H
+#ifndef Py_LIMITED_API
+#ifdef __cplusplus
+extern "C" {
 #endif
 
+
 #define _Py_UNLOCKED    0
 #define _Py_LOCKED      1
 
@@ -72,3 +76,10 @@ _PyMutex_IsLocked(PyMutex *m)
     return (_Py_atomic_load_uint8(&m->_bits) & _Py_LOCKED) != 0;
 }
 #define PyMutex_IsLocked _PyMutex_IsLocked
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif  // !Py_LIMITED_API
+#endif  // !Py_LOCK_H
diff --git a/Include/monitoring.h b/Include/monitoring.h
deleted file mode 100644 (file)
index 985f7f2..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef Py_MONITORING_H
-#define Py_MONITORING_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// There is currently no limited API for monitoring
-
-#ifndef Py_LIMITED_API
-#  define Py_CPYTHON_MONITORING_H
-#  include "cpython/monitoring.h"
-#  undef Py_CPYTHON_MONITORING_H
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* !Py_MONITORING_H */
diff --git a/Include/pylock.h b/Include/pylock.h
deleted file mode 100644 (file)
index 1939ef2..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef Py_LOCK_H
-#define Py_LOCK_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef Py_LIMITED_API
-#  define Py_CPYTHON_LOCK_H
-#  include "cpython/pylock.h"
-#  undef Py_CPYTHON_LOCK_H
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* !Py_LOCK_H */
index a356ac0ea943b207e2a6c927e50b096190f98017..061305a9ed11a74b378b58a3ad71122221da86dc 100644 (file)
@@ -1191,14 +1191,12 @@ PYTHON_HEADERS= \
                $(srcdir)/Include/intrcheck.h \
                $(srcdir)/Include/iterobject.h \
                $(srcdir)/Include/listobject.h \
-               $(srcdir)/Include/pylock.h \
                $(srcdir)/Include/longobject.h \
                $(srcdir)/Include/marshal.h \
                $(srcdir)/Include/memoryobject.h \
                $(srcdir)/Include/methodobject.h \
                $(srcdir)/Include/modsupport.h \
                $(srcdir)/Include/moduleobject.h \
-               $(srcdir)/Include/monitoring.h \
                $(srcdir)/Include/object.h \
                $(srcdir)/Include/objimpl.h \
                $(srcdir)/Include/opcode.h \
index e041943492d61fe13669ca4dfc0e17f963503d38..3f99836c1ebd83bdeb44b7c6973c33fa8936d60a 100644 (file)
@@ -1,8 +1,6 @@
 #include "parts.h"
 #include "util.h"
 
-#include "monitoring.h"
-
 #define Py_BUILD_CORE
 #include "internal/pycore_instruments.h"
 
index 25a7313eb264260693ee41b291ad471bec5aa6b5..248b63f25775da7ae61dc3c573fcb2344277c8c3 100644 (file)
     <ClInclude Include="..\Include\cpython\memoryobject.h" />
     <ClInclude Include="..\Include\cpython\methodobject.h" />
     <ClInclude Include="..\Include\cpython\modsupport.h" />
+    <ClInclude Include="..\Include\cpython\monitoring.h" />
     <ClInclude Include="..\Include\cpython\object.h" />
     <ClInclude Include="..\Include\cpython\objimpl.h" />
     <ClInclude Include="..\Include\cpython\odictobject.h" />
     <ClInclude Include="..\Include\intrcheck.h" />
     <ClInclude Include="..\Include\iterobject.h" />
     <ClInclude Include="..\Include\listobject.h" />
-    <ClInclude Include="..\Include\pylock.h" />
     <ClInclude Include="..\Include\longobject.h" />
     <ClInclude Include="..\Include\marshal.h" />
     <ClInclude Include="..\Include\memoryobject.h" />
index edbd88d930a43231fcb5152c9de149f42106ee11..da07a139b7c93d05132b884c232ff7b3356787c7 100644 (file)
     <ClInclude Include="..\Include\listobject.h">
       <Filter>Include</Filter>
     </ClInclude>
-    <ClInclude Include="..\Include\pylock.h">
-      <Filter>Include</Filter>
-    </ClInclude>
     <ClInclude Include="..\Include\longobject.h">
       <Filter>Include</Filter>
     </ClInclude>