aboutsummaryrefslogtreecommitdiff
path: root/backends/plugins
diff options
context:
space:
mode:
authorJohannes Schickel2008-07-27 11:07:38 +0000
committerJohannes Schickel2008-07-27 11:07:38 +0000
commit52e3dec37b260ca3dadaa03e66cd35552f79a9dc (patch)
treeae81869757bfe01c71b642de1bc95385f3026e70 /backends/plugins
parent4c7420125ec5b1549953e137176a5e6109459a5f (diff)
downloadscummvm-rg350-52e3dec37b260ca3dadaa03e66cd35552f79a9dc.tar.gz
scummvm-rg350-52e3dec37b260ca3dadaa03e66cd35552f79a9dc.tar.bz2
scummvm-rg350-52e3dec37b260ca3dadaa03e66cd35552f79a9dc.zip
Fixed win32 plugin provider.
svn-id: r33330
Diffstat (limited to 'backends/plugins')
-rw-r--r--backends/plugins/win32/win32-provider.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/backends/plugins/win32/win32-provider.cpp b/backends/plugins/win32/win32-provider.cpp
index 64636d8096..b8fdd3d802 100644
--- a/backends/plugins/win32/win32-provider.cpp
+++ b/backends/plugins/win32/win32-provider.cpp
@@ -50,21 +50,14 @@ protected:
virtual VoidFunc findSymbol(const char *symbol) {
#ifndef _WIN32_WCE
- void *func = (void *)GetProcAddress((HMODULE)_dlHandle, symbol);
+ FARPROC func = GetProcAddress((HMODULE)_dlHandle, symbol);
#else
- void *func = (void *)GetProcAddress((HMODULE)_dlHandle, toUnicode(symbol));
+ FARPROC func = GetProcAddress((HMODULE)_dlHandle, toUnicode(symbol));
#endif
if (!func)
debug("Failed loading symbol '%s' from plugin '%s'", symbol, _filename.c_str());
- // FIXME HACK: This is a HACK to circumvent a clash between the ISO C++
- // standard and POSIX: ISO C++ disallows casting between function pointers
- // and data pointers, but dlsym always returns a void pointer. For details,
- // see e.g. <http://www.trilithium.com/johan/2004/12/problem-with-dlsym/>.
- assert(sizeof(VoidFunc) == sizeof(func));
- VoidFunc tmp;
- memcpy(&tmp, &func, sizeof(VoidFunc));
- return tmp;
+ return (void (*)())func;
}
public: