]> granicus.if.org Git - python/commitdiff
Fix ssl module, Python 2.7 doesn't have Py_MAX (#5878)
authorChristian Heimes <christian@python.org>
Sun, 25 Feb 2018 12:08:05 +0000 (13:08 +0100)
committerGitHub <noreply@github.com>
Sun, 25 Feb 2018 12:08:05 +0000 (13:08 +0100)
Signed-off-by: Christian Heimes <christian@python.org>
Modules/_ssl.c

index af66a581e15a3f99c9d65157d1276cf4ab896b87..f9ed94dee1e17a240c8e31e4aea6e38d5679d25d 100644 (file)
@@ -610,7 +610,8 @@ newPySSLSocket(PySSLContext *sslctx, PySocketSockObject *sock,
         }
 #elif defined(HAVE_INET_PTON)
 #ifdef ENABLE_IPV6
-        char packed[Py_MAX(sizeof(struct in_addr), sizeof(struct in6_addr))];
+       #define PySSL_MAX(x, y) (((x) > (y)) ? (x) : (y))
+        char packed[PySSL_MAX(sizeof(struct in_addr), sizeof(struct in6_addr))];
 #else
         char packed[sizeof(struct in_addr)];
 #endif /* ENABLE_IPV6 */