CppCommon 1.0.5.0
C++ Common Library
Loading...
Searching...
No Matches
dll.inl
Go to the documentation of this file.
1
9namespace CppCommon {
10
11template <typename T>
12inline T* DLL::Resolve(const std::string& name) const
13{
14 return (T*)ResolveAddress(name);
15}
16
17inline std::string DLL::prefix()
18{
19#if defined(__CYGWIN__)
20 return "cyg";
21#elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) || defined(__MINGW32__) || defined(__MINGW64__)
22 return "lib";
23#else
24 return "";
25#endif
26}
27
28inline std::string DLL::extension()
29{
30#if defined(__APPLE__)
31 return ".dylib";
32#elif (defined(unix) || defined(__unix) || defined(__unix__)) && !defined(__CYGWIN__)
33 return ".so";
34#elif defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__)
35 return ".dll";
36#else
37 return "";
38#endif
39}
40
41inline void swap(DLL& dll1, DLL& dll2) noexcept
42{
43 dll1.swap(dll2);
44}
45
46} // namespace CppCommon
Dynamic link library.
Definition dll.h:56
static std::string extension()
Get the dynamic link library extension.
Definition dll.inl:28
T * Resolve(const std::string &name) const
Resolve dynamic link library symbol by the given name.
Definition dll.inl:12
static std::string prefix()
Get the dynamic link library prefix.
Definition dll.inl:17
C++ Common project definitions.
void swap(FileCache &cache1, FileCache &cache2) noexcept
Definition filecache.inl:23