From a9ee25a97e94e6a41b173016727215cc045bc52b Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Fri, 28 Aug 2015 17:53:31 +0200 Subject: [PATCH] various minor compilation fixes --- include/pybind/cast.h | 7 +++++-- include/pybind/functional.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/pybind/cast.h b/include/pybind/cast.h index b7c6558db..bf8959123 100644 --- a/include/pybind/cast.h +++ b/include/pybind/cast.h @@ -13,6 +13,7 @@ #include #include #include +#include NAMESPACE_BEGIN(pybind) NAMESPACE_BEGIN(detail) @@ -224,8 +225,10 @@ protected: bool load(PyObject *src, bool) { \ py_type py_value = from_type(src); \ if ((py_value == (py_type) -1 && PyErr_Occurred()) || \ - py_value < std::numeric_limits::min() || \ - py_value > std::numeric_limits::max()) { \ + (std::numeric_limits::is_integer && \ + sizeof(py_type) != sizeof(type) && \ + (py_value < std::numeric_limits::min() || \ + py_value > std::numeric_limits::max()))) { \ PyErr_Clear(); \ return false; \ } \ diff --git a/include/pybind/functional.h b/include/pybind/functional.h index 8f7aae821..7c3c9a006 100644 --- a/include/pybind/functional.h +++ b/include/pybind/functional.h @@ -24,7 +24,7 @@ public: return false; object src(src_, true); value = [src](Args... args) -> Return { - object retval(pybind::handle(src).call(std::move(args)...)); + object retval(pybind::handle(src).call(std::move(args)...)); /* Visual studio 2015 parser issue: need parentheses around this expression */ return (retval.template cast()); };