This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: sigsegv in compiled cygwin


On Sun, Feb 06, 2011 at 03:12:51AM +0900, jojelino wrote:
>i found small piece of code that need some comment.
>
>from trunk
>
>       int (*wsastartup) (int, WSADATA *);
>
>       /* Don't use autoload to load WSAStartup to eliminate recursion. */
>       wsastartup = (int (*)(int, WSADATA *))
>		   GetProcAddress ((HMODULE) (dll->handle), "WSAStartup");
>
>would have meant
>       typedef int __stdcall (*pfnwsastartup) (int, WSADATA *);
>       pfnwsastartup wsastartup;
>       wsastartup = (pfnwsastartup)
>		   GetProcAddress ((HMODULE) (dll->handle), "WSAStartup");
>
>otherwise stack frame would be damaged.

Why the typedef?

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]