diff options
Diffstat (limited to 'ace/Parse_Node.cpp')
-rw-r--r-- | ace/Parse_Node.cpp | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/ace/Parse_Node.cpp b/ace/Parse_Node.cpp index cda7c90ee05..da2bd33804d 100644 --- a/ace/Parse_Node.cpp +++ b/ace/Parse_Node.cpp @@ -519,26 +519,11 @@ ACE_Function_Node::symbol (ACE_Service_Object_Exterminator *gobbler) // Locate the factory function <function_name> in the shared // object. - char *function_name = ACE_const_cast (char *, - this->function_name_); - - // According to the new ANSI C++ specification, casting a void* - // pointer to a function pointer is not allowed. However, - // casting a void* pointer to an integer type that is large - // enough to hold the pointer value is legal. I (Nanbor) chose - // to cast the return value to long since it should be large - // enough to hold the void* pointer's value on most platforms. - // I am not sure if casting a long value to a function pointer - // is legal or not (can't find a good explanation in spec) but - // SunC++, egcs, and KAI compilers, all of which are pretty - // close to (or, at least claim to conform with) the standard - // did not complain about this as an illegal pointer conversion. - long temp_ptr = - ACE_reinterpret_cast(long, - ACE_OS::dlsym ((ACE_SHLIB_HANDLE) this->handle (), - ASYS_WIDE_STRING (function_name))); - func = ACE_reinterpret_cast(void *(*)(ACE_Service_Object_Exterminator *), - temp_ptr); + char *function_name = ACE_const_cast (char *, this->function_name_); + + func = (void *(*)(ACE_Service_Object_Exterminator *)) + ACE_OS::dlsym ((ACE_SHLIB_HANDLE) this->handle (), + ASYS_WIDE_STRING (function_name)); if (func == 0) { |