summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2020-11-05 00:04:58 +0300
committerMax Romanov <max.romanov@nginx.com>2020-11-05 00:04:58 +0300
commit4225361f0ea7d230c80209d76fbc67a932651380 (patch)
treece50c4d94d1c67842de725cd27bfacfc8fd0ce7d /src
parenta29d970f106ee10b57ab7ddf8fae4a02eac020b2 (diff)
downloadunit-4225361f0ea7d230c80209d76fbc67a932651380.tar.gz
unit-4225361f0ea7d230c80209d76fbc67a932651380.tar.bz2
Python: introducting macro to simplify minor version check.
Diffstat (limited to '')
-rw-r--r--src/python/nxt_python.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/python/nxt_python.h b/src/python/nxt_python.h
index 3dd04e31..6d7eba8e 100644
--- a/src/python/nxt_python.h
+++ b/src/python/nxt_python.h
@@ -11,6 +11,8 @@
#include <nxt_main.h>
#include <nxt_unit.h>
+#define NXT_PYTHON_VER(maj, min) ((maj << 24) | (min << 16))
+
#if PY_MAJOR_VERSION == 3
#define NXT_PYTHON_BYTES_TYPE "bytestring"
@@ -31,7 +33,7 @@
#define PyUnicode_GET_LENGTH PyUnicode_GET_SIZE
#endif
-#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 5
+#if PY_VERSION_HEX >= NXT_PYTHON_VER(3, 5)
#define NXT_HAVE_ASGI 1
#endif