diff options
author | Jens Arnold <amiconn@rockbox.org> | 2005-02-22 18:21:16 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2005-02-22 18:21:16 +0000 |
commit | cf208c50a2b52d0dd5a79567aeef4738c6082137 (patch) | |
tree | 00d332db0e95d8dcf58371846a5f393b25ee59c9 | |
parent | ba454115ece21d987f3d010360f7a6d68d2d2eb6 (diff) | |
download | rockbox-cf208c50a2b52d0dd5a79567aeef4738c6082137.tar.gz rockbox-cf208c50a2b52d0dd5a79567aeef4738c6082137.zip |
Killed some simulator warnings; proper plugin error reporting for Win32 simulator.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6039 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | uisimulator/common/io.c | 24 | ||||
-rw-r--r-- | uisimulator/win32/mpeg-win32.c | 3 |
2 files changed, 17 insertions, 10 deletions
diff --git a/uisimulator/common/io.c b/uisimulator/common/io.c index 48b888a027..33f1091314 100644 --- a/uisimulator/common/io.c +++ b/uisimulator/common/io.c @@ -289,11 +289,9 @@ int sim_fsync(int fd) #ifdef WIN32 /* sim-win32 */ -typedef enum plugin_status (*plugin_fn)(void* api, void* param); #define dlopen(_x_, _y_) LoadLibrary(_x_) -#define dlsym(_x_, _y_) (plugin_fn)GetProcAddress(_x_, _y_) +#define dlsym(_x_, _y_) (void *)GetProcAddress(_x_, _y_) #define dlclose(_x_) FreeLibrary(_x_) -#define dlerror() "Unknown" #else /* sim-x11 */ #include <dlfcn.h> @@ -303,17 +301,25 @@ void *sim_plugin_load(char *plugin, int *fd) { void* pd; char path[256]; - char buf[256]; int (*plugin_start)(void * api, void* param); - +#ifdef WIN32 + char buf[256]; +#endif + snprintf(path, sizeof path, "archos%s", plugin); *fd = -1; pd = dlopen(path, RTLD_NOW); if (!pd) { - snprintf(buf, sizeof buf, "failed to load %s", plugin); - DEBUGF("dlopen(%s): %s\n",path,dlerror()); + DEBUGF("failed to load %s\n", plugin); +#ifdef WIN32 + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, + buf, sizeof buf, NULL); + DEBUGF("dlopen(%s): %s\n", path, buf); +#else + DEBUGF("dlopen(%s): %s\n", path, dlerror()); +#endif dlclose(pd); return NULL; } @@ -326,13 +332,13 @@ void *sim_plugin_load(char *plugin, int *fd) return NULL; } } - *fd = pd; /* success */ + *fd = (int)pd; /* success */ return plugin_start; } void sim_plugin_close(int pd) { - dlclose(pd); + dlclose((void *)pd); } #ifndef WIN32 diff --git a/uisimulator/win32/mpeg-win32.c b/uisimulator/win32/mpeg-win32.c index 6f34befb8d..06adbfa012 100644 --- a/uisimulator/win32/mpeg-win32.c +++ b/uisimulator/win32/mpeg-win32.c @@ -33,4 +33,5 @@ void mpeg_bass(void) void mpeg_treble(void) { -}
\ No newline at end of file +} + |