Commit a9ee25a9 by Wenzel Jakob

various minor compilation fixes

parent 5d4d83da
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <pybind/pytypes.h> #include <pybind/pytypes.h>
#include <pybind/typeid.h> #include <pybind/typeid.h>
#include <array> #include <array>
#include <limits>
NAMESPACE_BEGIN(pybind) NAMESPACE_BEGIN(pybind)
NAMESPACE_BEGIN(detail) NAMESPACE_BEGIN(detail)
...@@ -224,8 +225,10 @@ protected: ...@@ -224,8 +225,10 @@ protected:
bool load(PyObject *src, bool) { \ bool load(PyObject *src, bool) { \
py_type py_value = from_type(src); \ py_type py_value = from_type(src); \
if ((py_value == (py_type) -1 && PyErr_Occurred()) || \ if ((py_value == (py_type) -1 && PyErr_Occurred()) || \
py_value < std::numeric_limits<type>::min() || \ (std::numeric_limits<type>::is_integer && \
py_value > std::numeric_limits<type>::max()) { \ sizeof(py_type) != sizeof(type) && \
(py_value < std::numeric_limits<type>::min() || \
py_value > std::numeric_limits<type>::max()))) { \
PyErr_Clear(); \ PyErr_Clear(); \
return false; \ return false; \
} \ } \
......
...@@ -24,7 +24,7 @@ public: ...@@ -24,7 +24,7 @@ public:
return false; return false;
object src(src_, true); object src(src_, true);
value = [src](Args... args) -> Return { value = [src](Args... args) -> Return {
object retval(pybind::handle(src).call<Args...>(std::move(args)...)); object retval(pybind::handle(src).call(std::move(args)...));
/* Visual studio 2015 parser issue: need parentheses around this expression */ /* Visual studio 2015 parser issue: need parentheses around this expression */
return (retval.template cast<Return>()); return (retval.template cast<Return>());
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment