summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-05-02 18:46:29 (GMT)
committerGitHub <noreply@github.com>2019-05-02 18:46:29 (GMT)
commit373893ce51b0eaf0dec901e36a3e4217fbed3e32 (patch)
tree8e9ca8c3793a3eed7dae4a3bb16a07ab453e93fb /Include
parent874ad1b3b4bfc782a5762c1f18234ba56b853caf (diff)
downloadcpython-373893ce51b0eaf0dec901e36a3e4217fbed3e32.zip
cpython-373893ce51b0eaf0dec901e36a3e4217fbed3e32.tar.gz
cpython-373893ce51b0eaf0dec901e36a3e4217fbed3e32.tar.bz2
bpo-36763: Add _PyCoreConfig._config_version (GH-13065)
Add private _config_version field to _PyPreConfig and _PyCoreConfig to prepare future ABI compatibility.
Diffstat (limited to 'Include')
-rw-r--r--Include/cpython/coreconfig.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/Include/cpython/coreconfig.h b/Include/cpython/coreconfig.h
index 99388e6..1aab5e4 100644
--- a/Include/cpython/coreconfig.h
+++ b/Include/cpython/coreconfig.h
@@ -65,7 +65,12 @@ typedef struct {
/* --- _PyPreConfig ----------------------------------------------- */
+#define _Py_CONFIG_VERSION 1
+
typedef struct {
+ int _config_version; /* Internal configuration version,
+ used for ABI compatibility */
+
/* If greater than 0, enable isolated mode: sys.path contains
neither the script's directory nor the user's site-packages directory.
@@ -132,6 +137,7 @@ typedef struct {
#define _PyPreConfig_INIT \
(_PyPreConfig){ \
_PyPreConfig_WINDOWS_INIT \
+ ._config_version = _Py_CONFIG_VERSION, \
.isolated = -1, \
.use_environment = -1, \
.dev_mode = -1, \
@@ -141,9 +147,12 @@ typedef struct {
/* --- _PyCoreConfig ---------------------------------------------- */
typedef struct {
- int isolated;
- int use_environment;
- int dev_mode;
+ int _config_version; /* Internal configuration version,
+ used for ABI compatibility */
+
+ int isolated; /* Isolated mode? see _PyPreConfig.isolated */
+ int use_environment; /* Use environment variables? see _PyPreConfig.use_environment */
+ int dev_mode; /* Development mode? See _PyPreConfig.dev_mode */
/* Install signal handlers? Yes by default. */
int install_signal_handlers;
@@ -397,6 +406,7 @@ typedef struct {
#define _PyCoreConfig_INIT \
(_PyCoreConfig){ \
_PyCoreConfig_WINDOWS_INIT \
+ ._config_version = _Py_CONFIG_VERSION, \
.isolated = -1, \
.use_environment = -1, \
.dev_mode = -1, \