X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FOS%2FDLLManager.cxx;fp=lib%2FcpPlugins%2FOS%2FDLLManager.cxx;h=0000000000000000000000000000000000000000;hb=2e142df11d6f312a2a2b5097b8da73571ed523e8;hp=ba13b368deb470d899f49e9f8c457cba9d3add8c;hpb=61b3659afe961ed248f30e26f9ca8f28fcfafddc;p=cpPlugins.git diff --git a/lib/cpPlugins/OS/DLLManager.cxx b/lib/cpPlugins/OS/DLLManager.cxx deleted file mode 100644 index ba13b36..0000000 --- a/lib/cpPlugins/OS/DLLManager.cxx +++ /dev/null @@ -1,50 +0,0 @@ -#include -#ifdef cpExtensions_OS_Windows -#else // cpExtensions_OS_Windows -# include -#endif // cpExtensions_OS_Windows - -// ------------------------------------------------------------------------- -void* cpPlugins::OS::DLLManager:: -Open( const std::string& filename ) -{ - void* hnd = NULL; -#ifdef cpExtensions_OS_Windows -#else // cpExtensions_OS_Windows - hnd = dlopen( filename.c_str( ), RTLD_NOW | RTLD_GLOBAL ); - char* error = dlerror( ); - if( error != NULL ) - throw std::runtime_error( error ); -#endif // cpExtensions_OS_Windows - return( hnd ); -} - -// ------------------------------------------------------------------------- -void cpPlugins::OS::DLLManager:: -Close( void* hnd ) -{ -#ifdef cpExtensions_OS_Windows -#else // cpExtensions_OS_Windows - /* TODO: why this clashes with VTK? -> Unregistering of factories. - dlclose( hnd ); - dlerror( ); - */ -#endif // cpExtensions_OS_Windows -} - -// ------------------------------------------------------------------------- -void* cpPlugins::OS::DLLManager:: -Sym( void* hnd, const std::string& symbol ) -{ - void* sym = NULL; -#ifdef cpExtensions_OS_Windows -#else // cpExtensions_OS_Windows - sym = dlsym( hnd, symbol.c_str( ) ); - char* error = dlerror( ); - if( error != NULL ) - throw std::runtime_error( error ); -#endif // cpExtensions_OS_Windows - return( sym ); -} - -// eof - $RCSfile$