diff options
Diffstat (limited to 'Source/cmDynamicLoader.cxx')
-rw-r--r-- | Source/cmDynamicLoader.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/Source/cmDynamicLoader.cxx b/Source/cmDynamicLoader.cxx index 8eff2e7..d9cd119 100644 --- a/Source/cmDynamicLoader.cxx +++ b/Source/cmDynamicLoader.cxx @@ -259,15 +259,14 @@ int cmDynamicLoader::CloseLibrary(cmLibHandle lib) cmDynamicLoaderFunction cmDynamicLoader::GetSymbolAddress(cmLibHandle lib, const char* sym) { - void* result = 0; #ifdef UNICODE - wchar_t *wsym = new wchar_t [mbstowcs(NULL, sym, 32000)]; - mbstowcs(wsym, sym, 32000); - void *ret = GetProcAddress(lib, wsym); - delete [] wsym; - result = ret; + wchar_t *wsym = new wchar_t [mbstowcs(NULL, sym, 32000)]; + mbstowcs(wsym, sym, 32000); + void *ret = GetProcAddress(lib, wsym); + delete [] wsym; + void* result = ret; #else - result = GetProcAddress(lib, sym); + void* result = GetProcAddress(lib, sym); #endif // Hack to cast pointer-to-data to pointer-to-function. return *reinterpret_cast<cmDynamicLoaderFunction*>(&result); |