From 52e3dec37b260ca3dadaa03e66cd35552f79a9dc Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 27 Jul 2008 11:07:38 +0000 Subject: Fixed win32 plugin provider. svn-id: r33330 --- backends/plugins/win32/win32-provider.cpp | 13 +++---------- 1 file 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. . - assert(sizeof(VoidFunc) == sizeof(func)); - VoidFunc tmp; - memcpy(&tmp, &func, sizeof(VoidFunc)); - return tmp; + return (void (*)())func; } public: -- cgit v1.2.3