summaryrefslogtreecommitdiffstats
path: root/uisimulator
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-02-22 18:21:16 +0000
committerJens Arnold <amiconn@rockbox.org>2005-02-22 18:21:16 +0000
commitcf208c50a2b52d0dd5a79567aeef4738c6082137 (patch)
tree00d332db0e95d8dcf58371846a5f393b25ee59c9 /uisimulator
parentba454115ece21d987f3d010360f7a6d68d2d2eb6 (diff)
downloadrockbox-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
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/common/io.c24
-rw-r--r--uisimulator/win32/mpeg-win32.c3
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
+}
+