10#ifndef MYGUI_DISABLE_PLUGINS
11#if MYGUI_PLATFORM == MYGUI_PLATFORM_WIN32
13# define MYGUI_DYNLIB_LOAD( a ) LoadLibrary( a )
14# define MYGUI_DYNLIB_GETSYM( a, b ) GetProcAddress( a, b )
15# define MYGUI_DYNLIB_UNLOAD( a ) !FreeLibrary( a )
16#elif MYGUI_PLATFORM == MYGUI_PLATFORM_LINUX
18# define MYGUI_DYNLIB_LOAD( a ) dlopen( a, RTLD_LAZY | RTLD_GLOBAL)
19# define MYGUI_DYNLIB_GETSYM( a, b ) dlsym( a, b )
20# define MYGUI_DYNLIB_UNLOAD( a ) dlclose( a )
21#elif MYGUI_PLATFORM == MYGUI_PLATFORM_APPLE
38#ifdef MYGUI_DISABLE_PLUGINS
39 MYGUI_EXCEPT(
"Plugins support disabled, rebuild MyGUI without MYGUI_DISABLE_PLUGINS");
44 std::string name =
mName;
45#if MYGUI_PLATFORM == MYGUI_PLATFORM_WIN32
46 const std::string extension =
".dll";
47#elif MYGUI_PLATFORM == MYGUI_PLATFORM_LINUX
48 const std::string extension =
".so";
50 const std::string extension =
"";
53 if (name.find(extension) == std::string::npos)
56#if MYGUI_PLATFORM == MYGUI_PLATFORM_APPLE
69#ifdef MYGUI_DISABLE_PLUGINS
70 MYGUI_EXCEPT(
"Plugins support disabled, rebuild MyGUI without MYGUI_DISABLE_PLUGINS");
74#if MYGUI_PLATFORM == MYGUI_PLATFORM_APPLE
87#ifdef MYGUI_DISABLE_PLUGINS
88 MYGUI_EXCEPT(
"Plugins support disabled, rebuild MyGUI without MYGUI_DISABLE_PLUGINS");
90#if MYGUI_PLATFORM == MYGUI_PLATFORM_APPLE
101#ifdef MYGUI_DISABLE_PLUGINS
102 MYGUI_EXCEPT(
"Plugins support disabled, rebuild MyGUI without MYGUI_DISABLE_PLUGINS");
104#if MYGUI_PLATFORM == MYGUI_PLATFORM_WIN32
107 FORMAT_MESSAGE_ALLOCATE_BUFFER |
108 FORMAT_MESSAGE_FROM_SYSTEM |
109 FORMAT_MESSAGE_IGNORE_INSERTS,
112 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
116 std::string ret = (
char*)lpMsgBuf;
118 LocalFree( lpMsgBuf );
121 return "no unix error function defined yet";
#define MYGUI_EXCEPT(dest)
#define MYGUI_LOG(level, text)
#define MYGUI_DYNLIB_LOAD(a)
#define MYGUI_DYNLIB_UNLOAD(a)
#define MYGUI_DYNLIB_GETSYM(a, b)
#define MYGUI_DYNLIB_HANDLE
std::string mName
Name of library.
std::string dynlibError() const
Gets the last loading error.
void * mInstance
Handle to the loaded library.
DynLib(const std::string &name)
std::string getName(void) const
Get the name of the library.
void * getSymbol(const std::string &strName) const noexcept