From 905074542ecd5be02a81de158bd8bd7a87dfc9b5 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Mon, 16 Jul 2001 00:10:27 +0000 Subject: [PATCH] VC60 workaround, to suppress bogus warning. [SVN r10629] --- example/richcmp.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/example/richcmp.cpp b/example/richcmp.cpp index 1fe130c3..68479fbb 100755 --- a/example/richcmp.cpp +++ b/example/richcmp.cpp @@ -188,16 +188,14 @@ ID_BINARY_OPERATORS( != ) boost::python::op_lt | boost::python::op_le |\ boost::python::op_eq | boost::python::op_ne) -BOOST_PYTHON_MODULE_INIT(richcmp) -{ - try - { - boost::python::module_builder richcmp_module("richcmp"); +namespace { + void init_module(boost::python::module_builder& this_module) + { boost::python::class_builder - dvect_class(richcmp_module, "dvect"); + dvect_class(this_module, "dvect"); boost::python::class_builder - ivect_class(richcmp_module, "ivect"); + ivect_class(this_module, "ivect"); dvect_class.def(boost::python::constructor()); dvect_class.def(&vects::dvect::as_tuple,"as_tuple"); @@ -235,5 +233,16 @@ BOOST_PYTHON_MODULE_INIT(richcmp) ivect_class.def(boost::python::operators(), boost::python::right_operand() ); } + +} // namespace + +BOOST_PYTHON_MODULE_INIT(richcmp) +{ + try { + boost::python::module_builder this_module("richcmp"); + // The actual work is done in separate function in order + // to suppress a bogus VC60 warning. + init_module(this_module); + } catch(...){boost::python::handle_exception();} }