Solaris doesn't like it when dlclose is referenced using a define,
resulting in a linker error looking for a symbol version. Simply
calling the function in a normal way (instead of storing its address)
solves this linking error.
The error message seen by GNU ld is:
dlclose: invalid version 7 (max 0)
return msg_buf;
}
-void
-p11_dl_close (void *dl)
-{
- FreeLibrary (dl);
-}
-
int
p11_thread_create (p11_thread_t *thread,
p11_thread_routine routine,
#endif /* HAVE_STRERROR_R */
+void
+p11_dl_close (void *dl)
+{
+#ifdef OS_WIN32
+ FreeLibrary (dl);
+#else
+ (void) dlclose (dl);
+#endif
+}
+
+
#ifdef OS_UNIX
#include <unistd.h>
char * strdup_path_mangle (const char *template);
+void p11_dl_close (void * dl);
+
/* -----------------------------------------------------------------------------
* WIN32
*/
char * p11_dl_error (void);
-void p11_dl_close (void * dl);
-
#define p11_sleep_ms(ms) \
(Sleep (ms))
#define p11_dl_open(f) \
(dlopen ((f), RTLD_LOCAL | RTLD_NOW))
-#define p11_dl_close \
- dlclose
#define p11_dl_symbol(d, s) \
(dlsym ((d), (s)))