From 63398011f942cb53bb9f02587dc62d6a6fe91b5d Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sat, 5 Feb 2011 19:38:21 +0000 Subject: [PATCH] * autoload.cc (wsock_init): Properly define WSAStartup function pointer to avoid stack damage. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/autoload.cc | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index ef4a624dc..42647b79a 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2011-02-05 Christopher Faylor + + * autoload.cc (wsock_init): Properly define WSAStartup function pointer + to avoid stack damage. + 2011-02-02 Corinna Vinschen * libc/bsdlib.cc: Include err.h. diff --git a/winsup/cygwin/autoload.cc b/winsup/cygwin/autoload.cc index 2e495ad6a..96de1439b 100644 --- a/winsup/cygwin/autoload.cc +++ b/winsup/cygwin/autoload.cc @@ -294,10 +294,10 @@ wsock_init () if (!wsock_started) { - int (*wsastartup) (int, WSADATA *); + int __stdcall (*wsastartup) (int, WSADATA *); /* Don't use autoload to load WSAStartup to eliminate recursion. */ - wsastartup = (int (*)(int, WSADATA *)) + wsastartup = (int __stdcall (*)(int, WSADATA *)) GetProcAddress ((HMODULE) (dll->handle), "WSAStartup"); if (wsastartup) {