~ubuntu-branches/ubuntu/wily/psi/wily

« back to all changes in this revision

Viewing changes to third-party/cppunit/cppunit/src/cppunit/UnixDynamicLibraryManager.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2008-08-28 18:46:52 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080828184652-iiik12dl91nq7cdi
Tags: 0.12-2
Uploading to unstable (Closes: Bug#494352)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <cppunit/Portability.h>
 
2
 
 
3
#if defined(CPPUNIT_HAVE_UNIX_DLL_LOADER)
 
4
#include <cppunit/plugin/DynamicLibraryManager.h>
 
5
 
 
6
#include <dlfcn.h>
 
7
#include <unistd.h>
 
8
 
 
9
 
 
10
CPPUNIT_NS_BEGIN
 
11
 
 
12
 
 
13
DynamicLibraryManager::LibraryHandle 
 
14
DynamicLibraryManager::doLoadLibrary( const std::string &libraryName )
 
15
{
 
16
  return ::dlopen( libraryName.c_str(), RTLD_NOW | RTLD_GLOBAL );
 
17
}
 
18
 
 
19
 
 
20
void 
 
21
DynamicLibraryManager::doReleaseLibrary()
 
22
{
 
23
  ::dlclose( m_libraryHandle);
 
24
}
 
25
 
 
26
 
 
27
DynamicLibraryManager::Symbol 
 
28
DynamicLibraryManager::doFindSymbol( const std::string &symbol )
 
29
{
 
30
  return ::dlsym ( m_libraryHandle, symbol.c_str() );
 
31
}
 
32
 
 
33
 
 
34
std::string 
 
35
DynamicLibraryManager::getLastErrorDetail() const
 
36
{
 
37
  return "";
 
38
}
 
39
 
 
40
 
 
41
CPPUNIT_NS_END
 
42
 
 
43
 
 
44
#endif // defined(CPPUNIT_HAVE_UNIX_DLL_LOADER)