Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
yade-dev
trunk
Commits
7707ab17
Commit
7707ab17
authored
Oct 29, 2010
by
Václav Šmilauer
Browse files
1. (hopefully) fix build with boost::serialization<1.42 broken by previous commit.
parent
cacc9589
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
4 deletions
+24
-4
core/corePlugins.cpp
core/corePlugins.cpp
+10
-2
lib/factory/ClassFactory.hpp
lib/factory/ClassFactory.hpp
+6
-1
lib/serialization/Serializable.hpp
lib/serialization/Serializable.hpp
+8
-1
No files found.
core/corePlugins.cpp
View file @
7707ab17
...
...
@@ -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
));
...
...
lib/factory/ClassFactory.hpp
View file @
7707ab17
...
...
@@ -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
...
...
lib/serialization/Serializable.hpp
View file @
7707ab17
...
...
@@ -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)\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment