- double start = xbt_os_time();
- if (boost::algorithm::ends_with(platf, ".so") or boost::algorithm::ends_with(platf, ".dylib")) {
-#ifdef _WIN32
- xbt_die("loading platform through shared library isn't supported on windows");
-#else
- void* handle = dlopen(platf.c_str(), RTLD_LAZY);
- xbt_assert(handle, "Impossible to open platform file: %s", platf.c_str());
- using load_fct_t = void (*)(const Engine&);
- dlerror();
- auto 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);
-#endif /* _WIN32 */
- } else {
- parse_platform_file(platf);
- }
-
- double end = xbt_os_time();
- XBT_DEBUG("PARSE TIME: %g", (end - start));