diff options
| author | 2020-11-04 13:31:03 +0000 | |
|---|---|---|
| committer | 2020-11-04 13:37:14 +0000 | |
| commit | 2310b03ad503a2712f868d52ce37ec6a3943e261 (patch) | |
| tree | f1fde6b7045d0c545f87809bc2afb3f596f23e4c /src/modules.cpp | |
| parent | Move config typedefs to ServerConfig and use auto in more places. (diff) | |
Initial support for platform-specific module file extensions.
Diffstat (limited to 'src/modules.cpp')
| -rw-r--r-- | src/modules.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/modules.cpp b/src/modules.cpp index 71e893866..021da42bc 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -612,12 +612,13 @@ ServiceProvider* ModuleManager::FindService(ServiceType type, const std::string& std::string ModuleManager::ExpandModName(const std::string& modname) { + const static size_t extlen = strlen(DLL_EXTENSION); std::string fullname; if (modname.compare(0, 5, "core_") != 0 && modname.compare(0, 2, "m_") != 0) fullname.append("m_"); fullname.append(modname); - if (modname.length() < 3 || modname.compare(modname.size() - 3, 3, ".so") != 0) - fullname.append(".so"); + if (modname.length() < extlen || modname.compare(modname.size() - extlen, extlen, DLL_EXTENSION) != 0) + fullname.append(DLL_EXTENSION); return fullname; } |
