aboutsummaryrefslogtreecommitdiffstats
path: root/3rdparty/pybind11/tests/pybind11_tests.h
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2021-01-02 10:15:39 +0100
committerMiodrag Milanovic <mmicko@gmail.com>2021-01-02 10:15:39 +0100
commite76cdab6dd77bad411e6ac9372ee527aff89ef17 (patch)
treee9868f05cf455336d75f33b1312d71034f8fb334 /3rdparty/pybind11/tests/pybind11_tests.h
parentc6cdf30501dcb2da01361229dd66a05dad73a132 (diff)
downloadnextpnr-e76cdab6dd77bad411e6ac9372ee527aff89ef17.tar.gz
nextpnr-e76cdab6dd77bad411e6ac9372ee527aff89ef17.tar.bz2
nextpnr-e76cdab6dd77bad411e6ac9372ee527aff89ef17.zip
Update pybind11 to version 2.6.1
Diffstat (limited to '3rdparty/pybind11/tests/pybind11_tests.h')
-rw-r--r--3rdparty/pybind11/tests/pybind11_tests.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/3rdparty/pybind11/tests/pybind11_tests.h b/3rdparty/pybind11/tests/pybind11_tests.h
index 90963a5d..4ff56c07 100644
--- a/3rdparty/pybind11/tests/pybind11_tests.h
+++ b/3rdparty/pybind11/tests/pybind11_tests.h
@@ -10,7 +10,7 @@ namespace py = pybind11;
using namespace pybind11::literals;
class test_initializer {
- using Initializer = void (*)(py::module &);
+ using Initializer = void (*)(py::module_ &);
public:
test_initializer(Initializer init);
@@ -18,9 +18,9 @@ public:
};
#define TEST_SUBMODULE(name, variable) \
- void test_submodule_##name(py::module &); \
+ void test_submodule_##name(py::module_ &); \
test_initializer name(#name, test_submodule_##name); \
- void test_submodule_##name(py::module &variable)
+ void test_submodule_##name(py::module_ &variable)
/// Dummy type which is not exported anywhere -- something to trigger a conversion error
@@ -50,16 +50,22 @@ public:
IncType &operator=(IncType &&) = delete;
};
+/// A simple union for basic testing
+union IntFloat {
+ int i;
+ float f;
+};
+
/// Custom cast-only type that casts to a string "rvalue" or "lvalue" depending on the cast context.
/// Used to test recursive casters (e.g. std::tuple, stl containers).
struct RValueCaster {};
-NAMESPACE_BEGIN(pybind11)
-NAMESPACE_BEGIN(detail)
+PYBIND11_NAMESPACE_BEGIN(pybind11)
+PYBIND11_NAMESPACE_BEGIN(detail)
template<> class type_caster<RValueCaster> {
public:
PYBIND11_TYPE_CASTER(RValueCaster, _("RValueCaster"));
static handle cast(RValueCaster &&, return_value_policy, handle) { return py::str("rvalue").release(); }
static handle cast(const RValueCaster &, return_value_policy, handle) { return py::str("lvalue").release(); }
};
-NAMESPACE_END(detail)
-NAMESPACE_END(pybind11)
+PYBIND11_NAMESPACE_END(detail)
+PYBIND11_NAMESPACE_END(pybind11)