Skip to content
Snippets Groups Projects
Commit fc5dee54 authored by Marco Biasini's avatar Marco Biasini
Browse files

fix compilation with gcc 4.1

For quite some time, gcc 4.1 (the default compiler on
CenOS 5.5) crashed when compiling ost. Turns out, that
gcc doesn't like the struct in anonymous namespaces in
instantitation some of the more arcance boost.python
templates. Once the anonymous namespaces are removed
everything works.
parent 0abd8870
Branches
Tags
No related merge requests found
......@@ -25,9 +25,6 @@ using namespace boost::python;
using namespace ost;
namespace {
struct WrappedLogSink : public LogSink {
WrappedLogSink(PyObject* self): self_(self)
{ }
......@@ -88,7 +85,6 @@ void reset_sinks()
{
Logger::Instance().ResetSinks();
}
}
void export_Logger()
{
......
......@@ -30,8 +30,7 @@ using namespace ost;
#ifdef OST_STATIC_PROPERTY_WORKAROUND
namespace {
struct Units_ {
struct Units_ {
Real get_m() { return Units::m; }
Real get_mm() { return Units::mm; }
Real get_nm() { return Units::nm; }
......@@ -53,9 +52,8 @@ namespace {
Real get_kDa() { return Units::kDa; }
Real get_Da() { return Units::Da; }
Real get_C() { return Units::C; }
};
};
} //ns
#endif
......
......@@ -36,12 +36,12 @@ extern void export_Composite2_op();
extern void export_Composite3_op();
extern void export_Quat();
namespace {
namespace details {
#if (defined(OST_STATIC_PROPERTY_WORKAROUND))
struct Axis_ {
int X() const { return geom::Axis::X; }
int Y() const { return geom::Axis::Y; }
int Z() const { return geom::Axis::Z; }
int X() { return geom::Axis::X; }
int Y() { return geom::Axis::Y; }
int Z() { return geom::Axis::Z; }
};
#else
struct Axis_ {};
......@@ -67,17 +67,17 @@ BOOST_PYTHON_MODULE(_geom)
#if (defined(OST_STATIC_PROPERTY_WORKAROUND))
// workaround for a problem with boost python and python 2.6.3/4
object axis=class_<Axis_>("Axis_")
.add_property("X", &Axis_::X)
.add_property("Y", &Axis_::Y)
.add_property("Z", &Axis_::Z)
class_<details::Axis_> axis("Axis_");
axis.add_property("X", &details::Axis_::X);
axis.add_property("Y", &details::Axis_::Y);
axis.add_property("Z", &details::Axis_::Z);
;
scope().attr("Axis")=axis();
#else
class_<Axis_>("Axis")
.def_readonly("X",geom::Axis::X)
.def_readonly("Y",geom::Axis::Y)
.def_readonly("Z",geom::Axis::Z)
class_<details::Axis_>("Axis")
.def_readonly("X", geom::Axis::X)
.def_readonly("Y", geom::Axis::Y)
.def_readonly("Z", geom::Axis::Z)
;
#endif
}
......@@ -34,8 +34,6 @@ using namespace boost::python;
using namespace ost;
using namespace ost::info;
namespace {
InfoHandle (*CreateInfoPtr1)()=CreateInfo;
InfoHandle (*CreateInfoPtr2)(const String&)=CreateInfo;
......@@ -145,7 +143,6 @@ InfoItem (InfoGroup::*create_item_b)(const String&, int)=&InfoGroup::CreateItem;
InfoItem (InfoGroup::*create_item_c)(const String&, bool)=&InfoGroup::CreateItem;
InfoItem (InfoGroup::*create_item_d)(const String&, Real)=&InfoGroup::CreateItem;
}
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getgroup_overloads, GetGroup, 1, 2)
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(retrievegroup_overloads, RetrieveGroup, 1, 2)
......
......@@ -23,8 +23,6 @@ using namespace boost::python;
using namespace ost;
using namespace ost::mol;
namespace {
struct WrappedVisitor : EntityVisitor
{
WrappedVisitor(PyObject *p)
......@@ -63,7 +61,6 @@ struct WrappedVisitor : EntityVisitor
PyObject* self;
};
}
void export_Visitor()
{
class_<EntityVisitor, WrappedVisitor>("EntityVisitor", init<>())
......
......@@ -38,7 +38,6 @@
using namespace ost;
using namespace ost::seq;
using namespace boost::python;
namespace {
void (SequenceHandle::*attach_one)(const mol::EntityView&)=&SequenceHandle::AttachView;
void (SequenceHandle::*attach_two)(const mol::EntityView&,
......@@ -240,7 +239,6 @@ void const_seq_handle_def(O& bp_class)
;
}
}
void export_sequence()
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment