diff --git a/external/rehlsdk/src/public/interface.cpp b/external/rehlsdk/src/public/interface.cpp index 816a099..05257a2 100644 --- a/external/rehlsdk/src/public/interface.cpp +++ b/external/rehlsdk/src/public/interface.cpp @@ -111,7 +111,7 @@ static IBaseInterface *CreateInterfaceLocal( const char *pName, int *pReturnCode //static hlds_run wants to use this function void *Sys_GetProcAddress( const char *pModuleName, const char *pName ) { - return GetProcAddress( GetModuleHandle(pModuleName), pName ); + return reinterpret_cast(GetProcAddress(GetModuleHandle(pModuleName), pName)); } //----------------------------------------------------------------------------- @@ -123,9 +123,9 @@ void *Sys_GetProcAddress( const char *pModuleName, const char *pName ) void *Sys_GetProcAddress( void *pModuleHandle, const char *pName ) { #if defined ( _WIN32 ) - return GetProcAddress( (HINSTANCE)pModuleHandle, pName ); + return reinterpret_cast(GetProcAddress((HINSTANCE)pModuleHandle, pName)); #else - return GetProcAddress( pModuleHandle, pName ); + return GetProcAddress(pModuleHandle, pName); #endif } @@ -249,16 +249,5 @@ CreateInterfaceFn Sys_GetFactoryThis( void ) //----------------------------------------------------------------------------- CreateInterfaceFn Sys_GetFactory( const char *pModuleName ) { -#if defined ( _WIN32 ) - return static_cast( Sys_GetProcAddress( pModuleName, CREATEINTERFACE_PROCNAME ) ); -#else -// Linux gives this error: -//../public/interface.cpp: In function `IBaseInterface *(*Sys_GetFactory -//(const char *)) (const char *, int *)': -//../public/interface.cpp:186: invalid static_cast from type `void *' to -//type `IBaseInterface *(*) (const char *, int *)' -// -// so lets use the old style cast. - return (CreateInterfaceFn)( Sys_GetProcAddress( pModuleName, CREATEINTERFACE_PROCNAME ) ); -#endif + return reinterpret_cast( Sys_GetProcAddress(pModuleName, CREATEINTERFACE_PROCNAME )); }