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/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:
|
|||||||
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:
|
|||||||
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>());
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user