From b3644e2ac648dbfc36d738119e4ca2d859f74a8a Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Sun, 7 Oct 2018 22:43:52 -0500 Subject: [PATCH] Fix macro call split by #if which confuses Visual Studio 2017 (#247 on Github) --- src/wrap_cl.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wrap_cl.hpp b/src/wrap_cl.hpp index bdd24796..843de9e4 100644 --- a/src/wrap_cl.hpp +++ b/src/wrap_cl.hpp @@ -2066,11 +2066,13 @@ namespace pyopencl #if PY_VERSION_HEX >= 0x03020000 if (PySlice_GetIndicesEx(slc.ptr(), + my_length, &start, &end, &stride, &length) != 0) + throw py::error_already_set(); #else if (PySlice_GetIndicesEx(reinterpret_cast(slc.ptr()), -#endif my_length, &start, &end, &stride, &length) != 0) throw py::error_already_set(); +#endif if (stride != 1) throw pyopencl::error("Buffer.__getitem__", CL_INVALID_VALUE, -- GitLab