|
@@ -18,6 +18,17 @@
|
|
|
|
|
|
|
|
namespace BansheeEngine
|
|
namespace BansheeEngine
|
|
|
{
|
|
{
|
|
|
|
|
+
|
|
|
|
|
+#if BS_PLATFORM == BS_PLATFORM_LINUX
|
|
|
|
|
+ const String DynLib::extension = "so";
|
|
|
|
|
+#elif BS_PLATFORM == BS_PLATFORM_OSX
|
|
|
|
|
+ const String DynLib::extension = "dylib";
|
|
|
|
|
+#elif BS_PLATFORM == BS_PLATFORM_WIN32
|
|
|
|
|
+ const String DynLib::extension = "dll";
|
|
|
|
|
+#else
|
|
|
|
|
+# error Unhandled platform
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
DynLib::DynLib(const String& name)
|
|
DynLib::DynLib(const String& name)
|
|
|
{
|
|
{
|
|
|
mName = name;
|
|
mName = name;
|
|
@@ -35,22 +46,7 @@ namespace BansheeEngine
|
|
|
if(m_hInst)
|
|
if(m_hInst)
|
|
|
return;
|
|
return;
|
|
|
|
|
|
|
|
- String name = mName;
|
|
|
|
|
-#if BS_PLATFORM == BS_PLATFORM_LINUX
|
|
|
|
|
- // dlopen() does not add .so to the filename, like windows does for .dll
|
|
|
|
|
- if (name.substr(name.length() - 3, 3) != ".so")
|
|
|
|
|
- name += ".so";
|
|
|
|
|
-#elif BS_PLATFORM == BS_PLATFORM_OSX
|
|
|
|
|
- // dlopen() does not add .dylib to the filename, like windows does for .dll
|
|
|
|
|
- if (name.substr(name.length() - 6, 6) != ".dylib")
|
|
|
|
|
- name += ".dylib";
|
|
|
|
|
-#elif BS_PLATFORM == BS_PLATFORM_WIN32
|
|
|
|
|
- // Although LoadLibraryEx will add .dll itself when you only specify the library name,
|
|
|
|
|
- // if you include a relative path then it does not. So, add it to be sure.
|
|
|
|
|
- if (name.substr(name.length() - 4, 4) != ".dll")
|
|
|
|
|
- name += ".dll";
|
|
|
|
|
-#endif
|
|
|
|
|
- m_hInst = (DYNLIB_HANDLE)DYNLIB_LOAD(name.c_str());
|
|
|
|
|
|
|
+ m_hInst = (DYNLIB_HANDLE)DYNLIB_LOAD(mName.c_str());
|
|
|
|
|
|
|
|
if(!m_hInst)
|
|
if(!m_hInst)
|
|
|
{
|
|
{
|