summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2010-05-26 18:34:39 +0200
committerAndreas Baumann <abaumann@yahoo.com>2010-05-26 18:34:39 +0200
commit168aabf1e128e21aa8ddcbae9ace1a65ff13a735 (patch)
tree2615e8244c15c1bcec0497974842d44f64e08ad2
parent81d9b2f2c6ed416550e8f626e8a6224dcc5d0239 (diff)
downloadwolfbones-168aabf1e128e21aa8ddcbae9ace1a65ff13a735.tar.gz
wolfbones-168aabf1e128e21aa8ddcbae9ace1a65ff13a735.tar.bz2
some cleanup in library loader
-rw-r--r--src/library/loader.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/library/loader.c b/src/library/loader.c
index 34d5426..0e2c1f7 100644
--- a/src/library/loader.c
+++ b/src/library/loader.c
@@ -76,7 +76,8 @@ wolf_library_p wolf_library_load( const char *name, wolf_error_t *error ) {
*error = WOLF_ERR_INTERNAL;
return l;
}
-#else
+#endif /* defined HAVE_DLFCN */
+
#if defined _WIN32
l->handle = LoadLibrary( name );
if( l->handle == NULL ) {
@@ -84,10 +85,7 @@ wolf_library_p wolf_library_load( const char *name, wolf_error_t *error ) {
*error = WOLF_ERR_INTERNAL;
return l;
}
-#else
-#error Not using DLFCN as shared loader. Port first!
-#endif
-#endif
+#endif /* defined _WIN32 */
*error = WOLF_OK;
return l;
@@ -114,17 +112,15 @@ wolf_error_t wolf_library_unload( wolf_library_p l ) {
strncpy( l->errbuf, dlerror( ), INTERNAL_ERRBUF_SIZE );
return WOLF_ERR_INTERNAL;
}
-#else
+#endif /* defined HAVE_DLFCN */
+
#if defined _WIN32
res = FreeLibrary( l->handle );
if( !res ) {
wolf_system_error_msg( l->errbuf, INTERNAL_ERRBUF_SIZE );
return WOLF_ERR_INTERNAL;
}
-#else
-#error Not using DLFCN as shared loader. Port first!
-#endif
-#endif
+#endif /* defined _WIN32 */
free( l );
l = NULL;
@@ -154,7 +150,8 @@ WOLF_LIBRARY_FUNCPTR wolf_library_get_func( const wolf_library_p l, const char *
*error = WOLF_ERR_INTERNAL;
return ret;
}
-#else
+#endif /* defined HAVE_DLFCN */
+
#if defined _WIN32
ret = GetProcAddress( l->handle, name );
if( ret == NULL ) {
@@ -162,10 +159,7 @@ WOLF_LIBRARY_FUNCPTR wolf_library_get_func( const wolf_library_p l, const char *
*error = WOLF_ERR_INTERNAL;
return ret;
}
-#else
-#error Not using DLFCN as shared loader. Port first!
-#endif
-#endif
+#endif /* defined _WIN32 */
*error = WOLF_OK;
return ret;