Commit 7707ab17 authored by Václav Šmilauer's avatar Václav Šmilauer
Browse files

1. (hopefully) fix build with boost::serialization<1.42 broken by previous commit.

parent cacc9589
......@@ -20,9 +20,17 @@
#include<yade/core/State.hpp>
#include<yade/core/TimeStepper.hpp>
#include<boost/version.hpp>
// these two are not accessible from python directly (though they should be in the future, perhaps)
BOOST_CLASS_EXPORT_IMPLEMENT(BodyContainer);
BOOST_CLASS_EXPORT_IMPLEMENT(InteractionContainer);
#if BOOST_VERSION>=104200
BOOST_CLASS_EXPORT_IMPLEMENT(BodyContainer);
BOOST_CLASS_EXPORT_IMPLEMENT(InteractionContainer);
#else
BOOST_CLASS_EXPORT(BodyContainer);
BOOST_CLASS_EXPORT(InteractionContainer);
#endif
YADE_PLUGIN((Body)(Bound)(Cell)(Dispatcher)(EnergyTracker)(Engine)(FileGenerator)(Functor)(GlobalEngine)(Interaction)(IGeom)(IPhys)(Material)(PartialEngine)(Shape)(State)(TimeStepper));
......
......@@ -38,6 +38,7 @@
Python wrapper defines O.saveXML('file.xml') to try it out.
Loading is not yet implemented (should be easy)
*/
#include<boost/version.hpp>
#include<boost/archive/binary_oarchive.hpp>
#include<boost/archive/binary_iarchive.hpp>
......@@ -178,7 +179,11 @@ class ClassFactory : public Singleton<ClassFactory>
* be unique and avoids use of __COUNTER__ which didn't appear in gcc until 4.3.
*/
#define _YADE_PLUGIN_BOOST_REGISTER(x,y,z) BOOST_CLASS_EXPORT_IMPLEMENT(z); BOOST_SERIALIZATION_FACTORY_0(z);
#if BOOST_VERSION>=104200
#define _YADE_PLUGIN_BOOST_REGISTER(x,y,z) BOOST_CLASS_EXPORT_IMPLEMENT(z); BOOST_SERIALIZATION_FACTORY_0(z);
#else
#define _YADE_PLUGIN_BOOST_REGISTER(x,y,z) BOOST_CLASS_EXPORT(z); BOOST_SERIALIZATION_FACTORY_0(z);
#endif
// the __attribute__((constructor(priority))) construct not supported before gcc 4.3
// it will only produce warning from log4cxx if not used
......
......@@ -19,6 +19,7 @@
# include<memory>
using std::shared_ptr;
#endif
#include<boost/version.hpp>
#include<boost/python.hpp>
#include<boost/type_traits.hpp>
#include<boost/lexical_cast.hpp>
......@@ -228,7 +229,13 @@ void make_setter_postLoad(C& instance, const T& val){ instance.*A=val; /* cerr<<
thisClass() BOOST_PP_IF(BOOST_PP_SEQ_SIZE(inits attrDecls),:,) BOOST_PP_SEQ_FOR_EACH_I(_ATTR_MAKE_INITIALIZER,BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(inits attrDecls)), inits BOOST_PP_SEQ_FOR_EACH(_ATTR_MAKE_INIT_TUPLE,~,attrDecls)) { ctor ; } /* ctor, with initialization of defaults */ \
_YADE_CLASS_BASE_DOC_ATTRS_DEPREC_PY(thisClass,baseClass,docString,BOOST_PP_SEQ_FOR_EACH(_ATTRS_EMBED_INI_TYP_IN_DOC,~,attrDecls),deprec,extras)
#define REGISTER_SERIALIZABLE(name) REGISTER_FACTORABLE(name); BOOST_CLASS_EXPORT_KEY(name);
// see https://bugs.launchpad.net/yade/+bug/666876
// we have to change things at a few other places as well
#if BOOST_VERSION>=104200
#define REGISTER_SERIALIZABLE(name) REGISTER_FACTORABLE(name); BOOST_CLASS_EXPORT_KEY(name);
#else
#define REGISTER_SERIALIZABLE(name) REGISTER_FACTORABLE(name);
#endif
// for static classes (Gl1 functors, for instance)
#define YADE_CLASS_BASE_DOC_STATICATTRS(thisClass,baseClass,docString,attrs)\
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment