bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getaddrinfo.c on windows


From: Simon Josefsson
Subject: Re: getaddrinfo.c on windows
Date: Fri, 07 Jul 2006 09:38:55 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux)

"Derek R. Price" <address@hidden> writes:

> Jim Hyslop reported needing the attached patch to compile getaddrinfo.c
> in MSVC6.
>
> 2006-07-06  Jim Hyslop  <address@hidden>
>
>       * 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.

Installed, thanks!

If there are more changes from Jim, I think he must do some paper-work
for gnulib, we now have two "tiny change" from him in this file.

/Simon

> Cheers,
>
> Derek
> --
> Derek R. Price
> CVS Solutions Architect
> Get CVS support at Ximbiot <http://ximbiot.com>!
> v: +1 248.835.1260
> f: +1 248.835.1263
> <mailto:address@hidden>
> --- lib/.#getaddrinfo.c.1.12  2006-07-06 22:28:14.000000000 -0400
> +++ lib/getaddrinfo.c 2006-07-06 22:33:29.000000000 -0400
> @@ -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);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]