From 0b8c870d0bf0eb509ff87d721cca1f3fd26cc0e2 Mon Sep 17 00:00:00 2001 From: Christoph Gohlke Date: Wed, 13 Mar 2013 17:27:24 -0700 Subject: [PATCH] Include zlib.h before Imaging.h Fixes a msvc compile error because various types get redefined --- _imaging.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/_imaging.c b/_imaging.c index 8b5d2a0f0..b62cd68b3 100644 --- a/_imaging.c +++ b/_imaging.c @@ -74,6 +74,10 @@ #include "Python.h" +#ifdef HAVE_LIBZ +#include "zlib.h" +#endif + #include "Imaging.h" #include "py3.h" @@ -3415,7 +3419,6 @@ setup_module(PyObject* m) { #endif #ifdef HAVE_LIBZ -#include "zlib.h" /* zip encoding strategies */ PyModule_AddIntConstant(m, "DEFAULT_STRATEGY", Z_DEFAULT_STRATEGY); PyModule_AddIntConstant(m, "FILTERED", Z_FILTERED);