From ae16c63925f3ac62c2979a1ff1159a1c4107d870 Mon Sep 17 00:00:00 2001
From: Gregor Thalhammer <gregor.thalhammer@gmail.com>
Date: Wed, 26 Aug 2015 18:28:47 +0200
Subject: [PATCH] fix: include mingw.mutex.h in addition to <mutex>

---
 src/c_wrapper/debug.h | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/c_wrapper/debug.h b/src/c_wrapper/debug.h
index d314da4..f070003 100644
--- a/src/c_wrapper/debug.h
+++ b/src/c_wrapper/debug.h
@@ -1,16 +1,11 @@
 #include "wrap_cl.h"
 #include "function.h"
 #include <string.h>
+#include <mutex>
 
 #ifdef __MINGW32__
-
 #include "mingw-std-threads/mingw.mutex.h"
 #include "mingw-std-threads/mingw.thread.h"
-
-#else
-
-#include <mutex>
-
 #endif
 
 #ifndef __PYOPENCL_DEBUG_H
-- 
1.9.5.msysgit.1

From 03692f84410e4f98b13cb1d4d06df7bf2542a728 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Wed, 26 Aug 2015 09:55:51 -0500
Subject: [PATCH] Py3 fix for the PyPy fix

---
 pyopencl/cffi_cl.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pyopencl/cffi_cl.py b/pyopencl/cffi_cl.py
index 1fdc28c..367fe98 100644
--- a/pyopencl/cffi_cl.py
+++ b/pyopencl/cffi_cl.py
@@ -26,6 +26,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
 """
 
+import six
 from six.moves import map, range, zip
 
 import warnings
@@ -479,7 +480,7 @@ class Error(Exception):
 
         def __init__(self, msg='', code=0, routine=''):
             self._routine = routine
-            assert isinstance(code, (int, long))
+            assert isinstance(code, six.integer_types)
             self._code = code
             self._what = msg
 
-- 
1.9.5.msysgit.1

