mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 05:05:11 +00:00
various minor compilation fixes
This commit is contained in:
parent
5d4d83da11
commit
a9ee25a97e
@ -13,6 +13,7 @@
|
||||
#include <pybind/pytypes.h>
|
||||
#include <pybind/typeid.h>
|
||||
#include <array>
|
||||
#include <limits>
|
||||
|
||||
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<type>::min() || \
|
||||
py_value > std::numeric_limits<type>::max()) { \
|
||||
(std::numeric_limits<type>::is_integer && \
|
||||
sizeof(py_type) != sizeof(type) && \
|
||||
(py_value < std::numeric_limits<type>::min() || \
|
||||
py_value > std::numeric_limits<type>::max()))) { \
|
||||
PyErr_Clear(); \
|
||||
return false; \
|
||||
} \
|
||||
|
@ -24,7 +24,7 @@ public:
|
||||
return false;
|
||||
object src(src_, true);
|
||||
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 */
|
||||
return (retval.template cast<Return>());
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user