diff options
5 files changed, 15 insertions, 0 deletions
diff --git a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/mapping.py b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/mapping.py index 816230475..e353aa5d8 100644 --- a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/mapping.py +++ b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/mapping.py @@ -231,6 +231,7 @@ type_map.update({ "List": ArrayLikeVariable, "Optional": typing.Optional, "long": int, + "long long": int, "nullptr": None, "PyCallable": typing.Callable, "PyObject": object, @@ -285,6 +286,7 @@ type_map.update({ "signed long": int, "std.list": typing.List, "std.map": typing.Dict, + "std.nullptr_t": NoneType, "std.pair": typing.Tuple, "std.string": str, "std.wstring": str, diff --git a/sources/shiboken6/tests/libsample/functions.cpp b/sources/shiboken6/tests/libsample/functions.cpp index ffa3722b7..7aca16250 100644 --- a/sources/shiboken6/tests/libsample/functions.cpp +++ b/sources/shiboken6/tests/libsample/functions.cpp @@ -263,3 +263,8 @@ std::wstring addStdWStrings(const std::wstring &s1, const std::wstring &s2) { return s1 + s2; } + +void testNullPtrT(std::nullptr_t t) +{ + cout << __FUNCTION__ << ' ' << t << '\n'; +} diff --git a/sources/shiboken6/tests/libsample/functions.h b/sources/shiboken6/tests/libsample/functions.h index 46ccd196c..273809d6c 100644 --- a/sources/shiboken6/tests/libsample/functions.h +++ b/sources/shiboken6/tests/libsample/functions.h @@ -89,6 +89,8 @@ LIBSAMPLE_API double sumDoubleMatrix(double m[2][3]); LIBSAMPLE_API std::string addStdStrings(const std::string &s1, const std::string &s2); LIBSAMPLE_API std::wstring addStdWStrings(const std::wstring &s1, const std::wstring &s2); +LIBSAMPLE_API void testNullPtrT(std::nullptr_t); + class LIBSAMPLE_API ArrayModifyTest { public: diff --git a/sources/shiboken6/tests/samplebinding/sample_test.py b/sources/shiboken6/tests/samplebinding/sample_test.py index 660a3cd3d..d3ae4e867 100644 --- a/sources/shiboken6/tests/samplebinding/sample_test.py +++ b/sources/shiboken6/tests/samplebinding/sample_test.py @@ -96,6 +96,10 @@ class ModuleTest(unittest.TestCase): self.assertEqual(sample.addStdStrings(t1, t1), expected) self.assertEqual(sample.addStdWStrings(t1, t1), expected) + def testNullPtrT(self): + sample.testNullPtrT(None) + self.assertRaises(TypeError, sample.testNullPtrT, 42) + if __name__ == '__main__': unittest.main() diff --git a/sources/shiboken6/tests/samplebinding/typesystem_sample.xml b/sources/shiboken6/tests/samplebinding/typesystem_sample.xml index 8891efdf6..7484a43f0 100644 --- a/sources/shiboken6/tests/samplebinding/typesystem_sample.xml +++ b/sources/shiboken6/tests/samplebinding/typesystem_sample.xml @@ -4,6 +4,7 @@ <suppress-warning text="Duplicate type entry: 'SampleNamespace'" /> <primitive-type name="ObjectType::Identifier"/> + <primitive-type name="std::nullptr_t"/> <primitive-type name="Foo::HANDLE" target-lang-api-name="PyLong"/> @@ -413,6 +414,7 @@ <function signature="overloadedFunc(int)" /> <function signature="addStdStrings(const std::string&, const std::string&)"/> <function signature="addStdWStrings(const std::wstring&, const std::wstring&)"/> + <function signature="testNullPtrT(std::nullptr_t)"/> <value-type name="ArrayModifyTest"> <modify-function signature="sumIntArray(int, int*)"> |