- double start = xbt_os_time();
- if (boost::algorithm::ends_with(platf, ".so")) {
- void* handle = dlopen(platf.c_str(), RTLD_LAZY);
- xbt_assert(handle, "Impossible to open platform file: %s", platf.c_str());
- typedef void (*load_fct_t)(const Engine&);
- dlerror();
- load_fct_t callable = (load_fct_t)dlsym(handle, "load_platform");
- const char* dlsym_error = dlerror();
- xbt_assert(not dlsym_error, "Error: %s", dlsym_error);
- callable(*this);
- dlclose(handle);
- } else {
- parse_platform_file(platf);
- }
-
- double end = xbt_os_time();
- XBT_DEBUG("PARSE TIME: %g", (end - start));
-}
-
-void Engine::register_function(const std::string& name, int (*code)(int, char**)) // XBT_ATTRIB_DEPRECATED_v329
-{
- kernel::actor::ActorCodeFactory code_factory = [code](std::vector<std::string> args) {
- return xbt::wrap_main(code, std::move(args));
- };
- register_function(name, code_factory);
-}
-void Engine::register_default(int (*code)(int, char**)) // XBT_ATTRIB_DEPRECATED_v329
-{
- register_default([code](std::vector<std::string> args) { return xbt::wrap_main(code, std::move(args)); });