2007-07-17 Pedro Alves <pedro_alves@portugalmail.pt>
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / unload.c
index 799bb55584a1d640cf479cd53f4e2d6c544408fc..f8c8046e9831d2d4fd4357c6d8a90208a6b265a6 100644 (file)
 
 #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);
     }
 
This page took 0.025953 seconds and 4 git commands to generate.