aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/unload.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.base/unload.c')
-rw-r--r--gdb/testsuite/gdb.base/unload.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/gdb/testsuite/gdb.base/unload.c b/gdb/testsuite/gdb.base/unload.c
index 799bb55..f8c8046 100644
--- a/gdb/testsuite/gdb.base/unload.c
+++ b/gdb/testsuite/gdb.base/unload.c
@@ -18,12 +18,19 @@
#include <stdio.h>
#include <stdlib.h>
+
+#ifdef __WIN32__
+#include <windows.h>
+#define dlopen(name, mode) LoadLibrary (name)
+#define dlsym(handle, func) GetProcAddress (handle, func)
+#define dlclose(handle) FreeLibrary (handle)
+#define dlerror() "error %d occurred", GetLastError ()
+#else
#include <dlfcn.h>
+#endif
int k = 0;
-#define SHLIB_NAME SHLIB_DIR "/unloadshr.sl"
-
int main()
{
void *handle;
@@ -32,11 +39,10 @@ int main()
const char *msg;
handle = dlopen (SHLIB_NAME, RTLD_LAZY);
- msg = dlerror ();
if (!handle)
{
- fprintf (stderr, msg);
+ fprintf (stderr, dlerror ());
exit (1);
}