summaryrefslogtreecommitdiff
path: root/src/library/loader.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/library/loader.c')
-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;