Skip to content

Commit

Permalink
xrCore: replace Module load file postfix on std:string
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleivg committed Oct 3, 2018
1 parent 98372be commit 21d6519
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/xrCore/ModuleLookup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,15 @@ void* ModuleHandle::Open(pcstr moduleName)
#ifdef WINDOWS
handle = LoadLibraryA(moduleName);
#elif defined(LINUX)
char buf[1024];
snprintf(buf, sizeof(buf), "%s.so", moduleName);

handle = dlopen(buf, RTLD_LAZY);
std::string soName = std::string(moduleName) + ".so";
handle = dlopen(soName.c_str(), RTLD_LAZY);
#endif
if (handle == nullptr)
{
#ifdef WINDOWS
Msg("! Failed to load DLL: 0x%d", GetLastError());
#elif defined(LINUX)
Msg("! Failed to load DLL: %s", dlerror());
Msg("! Failed to load DLL %s: %s", soName.c_str(), dlerror());
#endif
}

Expand Down

0 comments on commit 21d6519

Please sign in to comment.