* 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:
@ -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 ();})
|
||||
|
||||
|
Reference in New Issue
Block a user