Skip to content

Commit f829f34

Browse files
Add _PyRuntimeState.os.
1 parent 530cc9d commit f829f34

File tree

6 files changed

+30
-0
lines changed

6 files changed

+30
-0
lines changed

Include/internal/pycore_os.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#ifndef Py_INTERNAL_OS_H
2+
#define Py_INTERNAL_OS_H
3+
#ifdef __cplusplus
4+
extern "C" {
5+
#endif
6+
7+
#ifndef Py_BUILD_CORE
8+
# error "this header requires Py_BUILD_CORE define"
9+
#endif
10+
11+
12+
struct _os_runtime_state {
13+
int _not_used;
14+
};
15+
16+
#define _OS_RUNTIME_INIT {0}
17+
18+
19+
#ifdef __cplusplus
20+
}
21+
#endif
22+
#endif /* !Py_INTERNAL_OS_H */

Include/internal/pycore_runtime.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ extern "C" {
2020
#include "pycore_pymem.h" // struct _pymem_allocators
2121
#include "pycore_pyhash.h" // struct pyhash_runtime_state
2222
#include "pycore_obmalloc.h" // struct obmalloc_state
23+
#include "pycore_os.h" // struct _os_runtime_state
2324
#include "pycore_unicodeobject.h" // struct _Py_unicode_runtime_ids
2425

2526
struct _getargs_runtime_state {
@@ -102,6 +103,7 @@ typedef struct pyruntimestate {
102103
* KeyboardInterrupt exception, suggesting the user pressed ^C. */
103104
int unhandled_keyboard_interrupt;
104105
} signals;
106+
struct _os_runtime_state os;
105107

106108
struct pyinterpreters {
107109
PyThread_type_lock mutex;

Include/internal/pycore_runtime_init.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ extern "C" {
2626
}, \
2727
.obmalloc = _obmalloc_state_INIT(runtime.obmalloc), \
2828
.pyhash_state = pyhash_state_INIT, \
29+
.os = _OS_RUNTIME_INIT, \
2930
.interpreters = { \
3031
/* This prevents interpreters from getting created \
3132
until _PyInterpreterState_Enable() is called. */ \

Makefile.pre.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,6 +1654,7 @@ PYTHON_HEADERS= \
16541654
$(srcdir)/Include/internal/pycore_object.h \
16551655
$(srcdir)/Include/internal/pycore_obmalloc.h \
16561656
$(srcdir)/Include/internal/pycore_obmalloc_init.h \
1657+
$(srcdir)/Include/internal/pycore_os.h \
16571658
$(srcdir)/Include/internal/pycore_pathconfig.h \
16581659
$(srcdir)/Include/internal/pycore_pyarena.h \
16591660
$(srcdir)/Include/internal/pycore_pyerrors.h \

PCbuild/pythoncore.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@
236236
<ClInclude Include="..\Include\internal\pycore_object.h" />
237237
<ClInclude Include="..\Include\internal\pycore_obmalloc.h" />
238238
<ClInclude Include="..\Include\internal\pycore_obmalloc_init.h" />
239+
<ClInclude Include="..\Include\internal\pycore_os.h" />
239240
<ClInclude Include="..\Include\internal\pycore_pathconfig.h" />
240241
<ClInclude Include="..\Include\internal\pycore_pyarena.h" />
241242
<ClInclude Include="..\Include\internal\pycore_pyerrors.h" />

PCbuild/pythoncore.vcxproj.filters

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,9 @@
612612
<ClInclude Include="..\Include\internal\pycore_obmalloc_init.h">
613613
<Filter>Include\internal</Filter>
614614
</ClInclude>
615+
<ClInclude Include="..\Include\internal\pycore_os.h">
616+
<Filter>Include\internal</Filter>
617+
</ClInclude>
615618
<ClInclude Include="..\Include\internal\pycore_pathconfig.h">
616619
<Filter>Include\internal</Filter>
617620
</ClInclude>

0 commit comments

Comments
 (0)