summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2006-04-27 19:48:05 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2006-04-27 19:48:05 (GMT)
commit4e586c822fc959f2f8293af58677993c1d912dc5 (patch)
tree148d1f7d225b33bcc80209d35c06f529ddcc25be /Source
parent6c6eebac202e5988bfa2381cfe1d0bdafe40f01c (diff)
downloadCMake-4e586c822fc959f2f8293af58677993c1d912dc5.zip
CMake-4e586c822fc959f2f8293af58677993c1d912dc5.tar.gz
CMake-4e586c822fc959f2f8293af58677993c1d912dc5.tar.bz2
ENH: remove warning
Diffstat (limited to 'Source')
-rw-r--r--Source/kwsys/DynamicLoader.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/kwsys/DynamicLoader.cxx b/Source/kwsys/DynamicLoader.cxx
index 486d5b3..a044dff 100644
--- a/Source/kwsys/DynamicLoader.cxx
+++ b/Source/kwsys/DynamicLoader.cxx
@@ -359,10 +359,14 @@ int DynamicLoader::CloseLibrary(DynamicLoader::LibraryHandle lib)
DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
DynamicLoader::LibraryHandle lib, const char* sym)
{
- void* result = dlsym(lib, sym);
-
// Hack to cast pointer-to-data to pointer-to-function.
- return *reinterpret_cast<DynamicLoader::SymbolPointer*>(&result);
+ union
+ {
+ void* pvoid;
+ DynamicLoader::SymbolPointer psym;
+ } result;
+ result.pvoid = dlsym(lib, sym);
+ return result.psym;
}
//----------------------------------------------------------------------------