summaryrefslogtreecommitdiffstats
path: root/Modules/_gdbmmodule.c
diff options
context:
space:
mode:
authorXiang Zhang <angwerzx@126.com>2018-06-20 13:23:30 (GMT)
committerGitHub <noreply@github.com>2018-06-20 13:23:30 (GMT)
commitb248e957a818e268cfb221f3b94b37bc5672456a (patch)
tree121b943a976ef4d5487c5307b733bde366ab9cb8 /Modules/_gdbmmodule.c
parent16eb3bcdb22be4d82dc597b92b7154fcb11c6479 (diff)
downloadcpython-b248e957a818e268cfb221f3b94b37bc5672456a.zip
cpython-b248e957a818e268cfb221f3b94b37bc5672456a.tar.gz
cpython-b248e957a818e268cfb221f3b94b37bc5672456a.tar.bz2
Fix compiling error when missing gdbm version macros (GH-7823)
Diffstat (limited to 'Modules/_gdbmmodule.c')
-rw-r--r--Modules/_gdbmmodule.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/_gdbmmodule.c b/Modules/_gdbmmodule.c
index a68cf02..1056004 100644
--- a/Modules/_gdbmmodule.c
+++ b/Modules/_gdbmmodule.c
@@ -678,6 +678,8 @@ PyInit__gdbm(void) {
goto error;
}
+#if defined(GDBM_VERSION_MAJOR) && defined(GDBM_VERSION_MINOR) && \
+ defined(GDBM_VERSION_PATCH)
PyObject *obj = Py_BuildValue("iii", GDBM_VERSION_MAJOR,
GDBM_VERSION_MINOR, GDBM_VERSION_PATCH);
if (obj == NULL) {
@@ -687,6 +689,7 @@ PyInit__gdbm(void) {
Py_DECREF(obj);
goto error;
}
+#endif
return m;