From cdac34efeaa77d6ea82606e731f3c46c795e62b4 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Sun, 6 Jan 2002 14:40:33 +0000 Subject: [PATCH] Added wrapper for PyObject* [SVN r12234] --- src/converter/wrapper.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/converter/wrapper.cpp b/src/converter/wrapper.cpp index 0d817217..567ff99d 100644 --- a/src/converter/wrapper.cpp +++ b/src/converter/wrapper.cpp @@ -12,12 +12,6 @@ namespace boost { namespace python { namespace converter { wrapper_base::wrapper_base(type_id_t type) : body(type) { - // static assertions for target. These would go in a header, - // but Metrowerks only respects BOOST_STATIC_ASSERT if it is in an - // instantiated function -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -#else -#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION registry::insert(*this); } @@ -27,4 +21,21 @@ wrapper_base::~wrapper_base() registry::remove(*this); } +namespace +{ + // This doesn't actually get called, but we need something to fill + // in the slot in the wrap class. + struct identity_wrapper_t : wrapper + { + PyObject* convert(PyObject* source) const + { + return source; + } + }; + + identity_wrapper_t identity_wrapper_object; +} + +BOOST_PYTHON_DECL body& identity_wrapper = identity_wrapper_object; + }}} // namespace boost::python::converter