OSDN Git Service

* autoload.cc (kernel32_init): New function for kernel32 autoload
authorcgf <cgf>
Thu, 22 Mar 2001 03:42:07 +0000 (03:42 +0000)
committercgf <cgf>
Thu, 22 Mar 2001 03:42:07 +0000 (03:42 +0000)
initialization.
(SignalObjectAndWait): Add conditional load of this function when it is
available.

winsup/cygwin/ChangeLog
winsup/cygwin/autoload.cc

index 5a3811e..c092b5a 100644 (file)
@@ -1,3 +1,10 @@
+Wed Mar 21 22:12:36 2001  Christopher Faylor <cgf@cygnus.com>
+
+       * autoload.cc (kernel32_init): New function for kernel32 autoload
+       initialization.
+       (SignalObjectAndWait): Add conditional load of this function when it is
+       available.
+
 2001-03-21 Robert Collins <rbtcollins@hotmail.com>
 
        * sched.cc: New file.  Implement sched*.
index 850c020..c4b3711 100644 (file)
@@ -226,6 +226,21 @@ LoadDLLinitfunc (ole32)
   return 0;
 }
 
+LoadDLLinitfunc (kernel32)
+{
+  extern void wsock_init ();
+  HANDLE h;
+
+  if ((h = LoadLibrary ("kernel32.dll")) != NULL)
+    kernel32_handle = h;
+  else if (!kernel32_handle)
+    api_fatal ("could not load wsock32.dll.  Is TCP/IP installed?");
+  else
+    return 0;          /* Already done by another thread? */
+
+  return 0;
+}
+
 static void __stdcall dummy_autoload (void) __attribute__ ((unused));
 static void __stdcall
 dummy_autoload (void)
@@ -374,5 +389,8 @@ LoadDLLinit (ole32)
 LoadDLLfunc (CoInitialize, 4, ole32)
 LoadDLLfunc (CoUninitialize, 0, ole32)
 LoadDLLfunc (CoCreateInstance, 20, ole32)
+
+LoadDLLinit (kernel32)
+LoadDLLfuncEx (SignalObjectAndWait, 16, kernel32, 1)
 }
 }