Mercurial > hg > octave-lojdl > gnulib-hg
changeset 6936:6a9c52cb4144
2006-07-06 Jim Hyslop <jhyslop@dreampossible.ca> (tiny change)
* lib/getaddrinfo.c: Changes to compile under MSVC6: changed
'#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
brackets. Other minor changes to suppress some compiler
warnings.
author | Simon Josefsson <simon@josefsson.org> |
---|---|
date | Fri, 07 Jul 2006 07:37:16 +0000 |
parents | c7a96bfc8c0e |
children | b2e746cf6f89 |
files | lib/ChangeLog lib/getaddrinfo.c |
diffstat | 2 files changed, 18 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,10 @@ +2006-07-06 Jim Hyslop <jhyslop@dreampossible.ca> (tiny change) + + * lib/getaddrinfo.c: Changes to compile under MSVC6: changed + '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside + brackets. Other minor changes to suppress some compiler + warnings. + 2006-07-06 Paul Eggert <eggert@cs.ucla.edu> * getloadavg.c: Use __VMS, not VMS.
--- a/lib/getaddrinfo.c +++ b/lib/getaddrinfo.c @@ -47,11 +47,11 @@ #endif #ifdef WIN32_NATIVE -typedef int WSAAPI (*getaddrinfo_func) (const char*, const char*, +typedef int (WSAAPI *getaddrinfo_func) (const char*, const char*, const struct addrinfo*, struct addrinfo**); -typedef void WSAAPI (*freeaddrinfo_func) (struct addrinfo*); -typedef int WSAAPI (*getnameinfo_func) (const struct sockaddr*, +typedef void (WSAAPI *freeaddrinfo_func) (struct addrinfo*); +typedef int (WSAAPI *getnameinfo_func) (const struct sockaddr*, socklen_t, char*, DWORD, char*, DWORD, int); @@ -74,9 +74,9 @@ if (h) { - getaddrinfo_ptr = GetProcAddress (h, "getaddrinfo"); - freeaddrinfo_ptr = GetProcAddress (h, "freeaddrinfo"); - getnameinfo_ptr = GetProcAddress (h, "getnameinfo"); + getaddrinfo_ptr = (getaddrinfo_func) GetProcAddress (h, "getaddrinfo"); + freeaddrinfo_ptr = (freeaddrinfo_func) GetProcAddress (h, "freeaddrinfo"); + getnameinfo_ptr = (getnameinfo_func) GetProcAddress (h, "getnameinfo"); } /* If either is missing, something is odd. */ @@ -296,7 +296,10 @@ { #ifdef WIN32_NATIVE if (use_win32_p ()) - return freeaddrinfo_ptr (ai); + { + freeaddrinfo_ptr (ai); + return; + } #endif while (ai) @@ -316,7 +319,7 @@ char *restrict service, socklen_t servicelen, int flags) { -#if WIN32_NATIVE +#ifdef WIN32_NATIVE if (use_win32_p ()) return getnameinfo_ptr (sa, salen, node, nodelen, service, servicelen, flags);