13#if __DCL_HAVE_ALLOC_DEBUG
14#undef __DCL_ALLOC_LEVEL
15#define __DCL_ALLOC_LEVEL __DCL_ALLOC_INTERNAL
21#if __DCL_HAVE_THIS_FILE__
44 __message = _name +
__T(
" ") + _message;
49 StringBuilder
r = __message;
70 catch (DllException* e) {
82 const String& _filename,
int _flags
89 HINSTANCE handle = LoadLibraryExW(
92 LOAD_WITH_ALTERED_SEARCH_PATH
99 if (_filename[(
size_t) 0] == L
'/') {
104 if ((_flags & RTLD_BINDING_MASK) == 0)
107 void* handle =
__dlopen(_filename, _flags);
108 if (handle ==
NULL) {
115 __filename = _filename;
116 __handle = (
void*)handle;
127 if (::FreeLibrary((HINSTANCE) handle) ==
FALSE)
131 if (dlclose(handle) != 0) {
141void* Dll::getAddress(
const char* _symbol)
150 r = (
void*) GetProcAddress((HINSTANCE)__handle, _symbol);
154 __filename + L
"::" + symbol,
159 r = dlsym(__handle, _symbol);
166 __filename + L
"::" + symbol,
DCLCAPI int __dlerror(String &r)
DCLCAPI void * __dlopen(const String &_filename, int _flag)
#define __DCL_TRACE1(fmt, arg1)
#define __DCL_VERIFY(expr)
#define __DCL_ASSERT(expr)
#define IMPLEMENT_CLASSINFO(class_name, base_class_name)
static String decode(const char *_mbs, size_t _mbslen=(size_t) -1)
DllException(const String &_name, Exception *_cause)
virtual String toString() const
static bool exists(const String &_path)
virtual String toString() const
SysError(Exception *_cause=NULL)