* autoload.cc: Use new definition of LoadDLLinitfunc throughout.

Redefine wrapper for wsock32.dll and ws2_32.dll.
        (std_dll_init): New function.
        * autoload.h: Rename LoadDLLinitfunc to LoadDLLinitfuncdef.
        Add new defines LoadDLLinitfunc and LoadDLLstdfunc.
        * net.cc (wsock_init): Add guard variable handling. Take care
        to call WSAStartup only once. Load WSAStartup without using
        autoload wrapper to eliminate recursion.  Eliminate FIONBIO
        and srandom stuff.
This commit is contained in:
Corinna Vinschen
2001-05-03 09:35:08 +00:00
parent b09e3cf8fd
commit a6a0193b2f
4 changed files with 84 additions and 216 deletions

View File

@ -11,10 +11,20 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */
#define LoadDLLinitfunc(dllname) \
LoadDLLinitfuncdef(dllname) \
{ \
return LoadDLLstdfunc(dllname); \
}
#define LoadDLLinitfuncdef(dllname) \
HANDLE NO_COPY dllname ## _handle = NULL; \
LONG NO_COPY dllname ## _here = -1L; \
/*static*/ int dllname ## _init () __asm__ (#dllname "_init"); \
/*static*/ int dllname ## _init ()
#define LoadDLLstdfunc(dllname) \
std_dll_init (dllname ## _handle, #dllname ".dll", dllname ## _here)
#define LoadDLLinitnow(dllname) \
({__asm__ ("movl $cygwin_dll_func_load, " #dllname "_init_holder"); dllname##_init ();})