Fri Jan 26 13:06:57 CET 2007 Paolo Molaro <lupus@ximian.com>
authorPaolo Molaro <lupus@oddwiz.org>
Fri, 26 Jan 2007 12:07:32 +0000 (12:07 -0000)
committerPaolo Molaro <lupus@oddwiz.org>
Fri, 26 Jan 2007 12:07:32 +0000 (12:07 -0000)
* mono-dl.h, mono-dl.c: make symbols internal and fixes.

svn path=/trunk/mono/; revision=71746

mono/utils/ChangeLog
mono/utils/mono-dl.c
mono/utils/mono-dl.h

index 4bb6fedb2d72d4ca8288ca88f35dc45665c04a60..26193969fde555329bd470f52dffed4cf5c600a3 100644 (file)
@@ -1,4 +1,8 @@
 
+Fri Jan 26 13:06:57 CET 2007 Paolo Molaro <lupus@ximian.com>
+
+       * mono-dl.h, mono-dl.c: make symbols internal and fixes.
+
 Wed Jan 24 23:20:17 CET 2007 Paolo Molaro <lupus@ximian.com>
 
        * mono-codeman.c: don't call mono_mprotect() on windows.
index c65e380e9228fb6d0d9a967aec44bb879aa74b5f..18edc792af651111d64fa728dacb5e1700f1a1a8 100644 (file)
@@ -32,8 +32,8 @@ static const char suffixes [][4] = {
 
 #define SO_HANDLE_TYPE HMODULE
 #define LL_SO_OPEN(file,flags) (file)? LoadLibrary ((file)): GetModuleHandle (NULL)
-#define LL_SO_CLOSE(module) do { if ((module)->main_module) FreeLibrary ((module)->handle); } while (0)
-#define LL_SO_SYMBOL(handle, name) GetProcAddress ((handle), (name))
+#define LL_SO_CLOSE(module) do { if (!(module)->main_module) FreeLibrary ((module)->handle); } while (0)
+#define LL_SO_SYMBOL(module, name) GetProcAddress ((module)->handle, (name))
 #define LL_SO_TRFLAGS(flags) 0
 #define LL_SO_ERROR() w32_dlerror ()
 
@@ -62,8 +62,8 @@ w32_dlerror (void)
 
 #define SO_HANDLE_TYPE void*
 #define LL_SO_OPEN(file,flags) dlopen ((file), (flags))
-#define LL_SO_CLOSE(handle) dlclose ((handle))
-#define LL_SO_SYMBOL(handle, name) dlsym ((handle), (name))
+#define LL_SO_CLOSE(module) dlclose ((module)->handle)
+#define LL_SO_SYMBOL(module, name) dlsym ((module)->handle, (name))
 #define LL_SO_TRFLAGS(flags) convert_flags ((flags))
 #define LL_SO_ERROR() g_strdup (dlerror ())
 
@@ -83,8 +83,8 @@ convert_flags (int flags)
 /* no duynamic loader supported */
 #define SO_HANDLE_TYPE void*
 #define LL_SO_OPEN(file,flags) NULL
-#define LL_SO_CLOSE(handle) 
-#define LL_SO_SYMBOL(handle, name) NULL
+#define LL_SO_CLOSE(module) 
+#define LL_SO_SYMBOL(module, name) NULL
 #define LL_SO_TRFLAGS(flags) (flags)
 #define LL_SO_ERROR() g_strdup ("No support for dynamic loader")
 
@@ -262,11 +262,11 @@ mono_dl_symbol (MonoDl *module, const char *name, void **symbol)
                char *usname = malloc (strlen (name) + 2);
                *usname = '_';
                strcpy (usname + 1, name);
-               sym = LL_SO_SYMBOL (module->handle, usname);
+               sym = LL_SO_SYMBOL (module, usname);
                free (usname);
        }
 #else
-       sym = LL_SO_SYMBOL (module->handle, name);
+       sym = LL_SO_SYMBOL (module, name);
 #endif
        if (sym) {
                if (symbol)
index 3092deece0ff31fc0186ebf854b669775ea696f4..3a469b5aa7324aab5704fa3c50b4a69f1dbd6da0 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef __MONO_UTILS_DL_H__
 #define __MONO_UTILS_DL_H__
 
+#include "mono/utils/mono-compiler.h"
+
 enum {
        MONO_DL_LAZY  = 1,
        MONO_DL_LOCAL = 2,
@@ -9,11 +11,11 @@ enum {
 
 typedef struct _MonoDl MonoDl;
 
-MonoDl*     mono_dl_open       (const char *name, int flags, char **error_msg);
-char*       mono_dl_symbol     (MonoDl *module, const char *name, void **symbol);
-void        mono_dl_close      (MonoDl *module);
+MonoDl*     mono_dl_open       (const char *name, int flags, char **error_msg) MONO_INTERNAL;
+char*       mono_dl_symbol     (MonoDl *module, const char *name, void **symbol) MONO_INTERNAL;
+void        mono_dl_close      (MonoDl *module) MONO_INTERNAL;
 
-char*       mono_dl_build_path (const char *directory, const char *name, void **iter);
+char*       mono_dl_build_path (const char *directory, const char *name, void **iter) MONO_INTERNAL;
 
 #endif /* __MONO_UTILS_DL_H__ */