summaryrefslogtreecommitdiffstats
path: root/Include/compile.h
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-06-13 00:16:41 (GMT)
committerGitHub <noreply@github.com>2019-06-13 00:16:41 (GMT)
commit37d66d7d4bc7dbac9809d69966a774ebb32563be (patch)
tree510316d9aafcba8dc519e9df877c3f20c7f005f9 /Include/compile.h
parent2c9b498759f4fc74da82a0a96d059d666fa73f16 (diff)
downloadcpython-37d66d7d4bc7dbac9809d69966a774ebb32563be.zip
cpython-37d66d7d4bc7dbac9809d69966a774ebb32563be.tar.gz
cpython-37d66d7d4bc7dbac9809d69966a774ebb32563be.tar.bz2
bpo-37253: Add _PyCompilerFlags_INIT macro (GH-14018)
Add a new _PyCompilerFlags_INIT macro to initialize PyCompilerFlags variables, rather than initializing cf_flags and cf_feature_version explicitly in each variable.
Diffstat (limited to 'Include/compile.h')
-rw-r--r--Include/compile.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Include/compile.h b/Include/compile.h
index a833caa..1cda955 100644
--- a/Include/compile.h
+++ b/Include/compile.h
@@ -30,6 +30,9 @@ typedef struct {
int cf_flags; /* bitmask of CO_xxx flags relevant to future */
int cf_feature_version; /* minor Python version (PyCF_ONLY_AST) */
} PyCompilerFlags;
+
+#define _PyCompilerFlags_INIT \
+ (PyCompilerFlags){.cf_flags = 0, .cf_feature_version = PY_MINOR_VERSION}
#endif
/* Future feature support */