File tree 1 file changed +20
-4
lines changed
1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -116,17 +116,33 @@ class CPluginMgr : public CErrorHandler
116
116
m_sFilePath = sPath ;
117
117
}
118
118
119
+ #ifdef WINDOWS
120
+
121
+ HINSTANCE hLib = LoadLibrary (m_sFilePath.c_str ());
122
+ if (hLib == NULL )
123
+ {
124
+ SetErrorText (" Failed to load lib at specified path" );
125
+ return false ;
126
+ }
127
+
128
+ auto createPluginInterface = (CreatePluginInterface) GetProcAddress (hDll, " CreatePluginInterface" );
129
+
130
+ #else
131
+
119
132
void *pLib = dlopen (m_sFilePath.c_str (), RTLD_NOW | RTLD_GLOBAL);
120
- if (pLib == void )
133
+ if (pLib == nullptr )
121
134
{
122
135
auto message = dlerror ();
123
136
124
- SetErrorText (" Failed to load lib at specified path - " + message);
137
+ SetErrorText (" Failed to load lib at specified path " + message);
125
138
return false ;
126
139
}
127
140
128
- auto createPluginInterface = (CreatePluginInterface)dlsym (pLib, " CreatePluginInterface" );
129
- if (createPluginInterface)
141
+ auto createPluginInterface = (CreatePluginInterface) dlsym (pLib, " CreatePluginInterface" );
142
+
143
+ #endif
144
+
145
+ if (createPluginInterface != nullptr )
130
146
{
131
147
m_pPluginInterface = createPluginInterface ();
132
148
}
You can’t perform that action at this time.
0 commit comments