Blame SOURCES/00299-fix-ssl-module-pymax.patch

d2206e
From 439956a149f8a3eb44646498c63b2ef3337d5f3d Mon Sep 17 00:00:00 2001
d2206e
From: Christian Heimes <christian@python.org>
d2206e
Date: Sun, 25 Feb 2018 13:08:05 +0100
d2206e
Subject: [PATCH] Fix ssl module, Python 2.7 doesn't have Py_MAX (#5878)
d2206e
d2206e
Signed-off-by: Christian Heimes <christian@python.org>
d2206e
---
d2206e
 Modules/_ssl.c | 3 ++-
d2206e
 1 file changed, 2 insertions(+), 1 deletion(-)
d2206e
d2206e
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
d2206e
index af66a581e15a..f9ed94dee1e1 100644
d2206e
--- a/Modules/_ssl.c
d2206e
+++ b/Modules/_ssl.c
d2206e
@@ -610,7 +610,8 @@ newPySSLSocket(PySSLContext *sslctx, PySocketSockObject *sock,
d2206e
         }
d2206e
 #elif defined(HAVE_INET_PTON)
d2206e
 #ifdef ENABLE_IPV6
d2206e
-        char packed[Py_MAX(sizeof(struct in_addr), sizeof(struct in6_addr))];
d2206e
+	#define PySSL_MAX(x, y) (((x) > (y)) ? (x) : (y))
d2206e
+        char packed[PySSL_MAX(sizeof(struct in_addr), sizeof(struct in6_addr))];
d2206e
 #else
d2206e
         char packed[sizeof(struct in_addr)];
d2206e
 #endif /* ENABLE_IPV6 */