From d0d576d61d65f7b42db1cc7331f1c7c9879e90e9 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Fri, 21 May 2010 15:31:37 +0200 Subject: final cleanup in documentation of library loader --- TODOS | 5 +++-- include/wolf/library/loader.h | 4 ++++ tests/library/test_loader.c | 5 +---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/TODOS b/TODOS index 5cc5f1e..147ca1e 100644 --- a/TODOS +++ b/TODOS @@ -1,5 +1,6 @@ - library loader - - do Windows version - make install installs the testlib, split in two - check if we can get variable symbols on Windows - - find a nice macro layer for the void * dlsym casting + - add error handling on Windows + - find solution for char *, TCHAR unicode and friends + \ No newline at end of file diff --git a/include/wolf/library/loader.h b/include/wolf/library/loader.h index 19979af..437fa1b 100644 --- a/include/wolf/library/loader.h +++ b/include/wolf/library/loader.h @@ -58,6 +58,10 @@ typedef struct wolf_library_t *wolf_library_p; * * Reason: conversion from void * to function pointer is illegal by ISO-99 * (though it works actually on Posix) + * + * for the reasons why naive casting doesn't work with dlsym, see: + * + * http://en.wikipedia.org/wiki/Dynamic_loading */ #if defined _WIN32 #define WOLF_LIBRARY_FUNC_CAST( symbol__, func_t__, func__ ) func__ = (func_t__)symbol__ diff --git a/tests/library/test_loader.c b/tests/library/test_loader.c index ddcdbc5..50ed8db 100644 --- a/tests/library/test_loader.c +++ b/tests/library/test_loader.c @@ -44,10 +44,7 @@ int main( void ) { return EXIT_FAILURE; } - /* fetch a known function symbol (multiply_by_two), for the reasons why naive - * casting doesn't work, see: - * http://en.wikipedia.org/wiki/Dynamic_loading - */ + /* fetch a known function symbol (multiply_by_two) */ symbol = wolf_library_get_func( library, "multiply_by_two", &error ); if( error != WOLF_OK ) { fprintf( stderr, "Error %d fetching a function from the library: %s\n", -- cgit v1.2.3-54-g00ecf