Cogs.Core
Module.Emscripten.cpp
1#include "Module.h"
2
3#include <dlfcn.h>
4
5void Cogs::Module::load(const std::string& path, LoadStatus& status, void*& handle) {
6 handle = dlopen(path.data(), RTLD_NOW);
7 status = handle ? LoadStatus::Loaded : LoadStatus::Failed;
8}
9
10void Cogs::Module::unload(void* handle) {
11 if (handle) {
12 dlclose(handle);
13 }
14}
15
16void* Cogs::Module::getProcAddress(void* /*handle*/, const char* /*procName*/) {
17 return nullptr;
18}
static void load(const std::string &path, LoadStatus &status, void *&handle)
Attempts to load a shared library with the given name.