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

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