diff --git a/base/dynamicobject.h b/base/dynamicobject.h index d0a459ca9..025959b2f 100644 --- a/base/dynamicobject.h +++ b/base/dynamicobject.h @@ -155,8 +155,14 @@ public: } }; +template<typename T> +shared_ptr<T> DynamicObjectFactory(const Dictionary::Ptr& serializedUpdate) +{ + return boost::make_shared<T>(serializedUpdate); +} + #define REGISTER_CLASS(klass) \ - static RegisterClassHelper g_Register ## klass(#klass, boost::make_shared<klass, const Dictionary::Ptr&>) + static RegisterClassHelper g_Register ## klass(#klass, DynamicObjectFactory<klass>) } diff --git a/base/scriptfunction.h b/base/scriptfunction.h index da348c386..94bbc7138 100644 --- a/base/scriptfunction.h +++ b/base/scriptfunction.h @@ -49,4 +49,5 @@ private: } -#endif /* SCRIPTFUNCTION_H */ \ No newline at end of file +#endif /* SCRIPTFUNCTION_H */ + diff --git a/base/unix.h b/base/unix.h index 0e790f2b2..31e5ae9c0 100644 --- a/base/unix.h +++ b/base/unix.h @@ -35,6 +35,7 @@ #include <libgen.h> #include <syslog.h> #include <sys/file.h> +#include <sys/wait.h> void Sleep(unsigned long milliseconds);