[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
getaddrinfo.c on windows
From: |
Derek R. Price |
Subject: |
getaddrinfo.c on windows |
Date: |
Thu, 06 Jul 2006 22:43:36 -0400 |
User-agent: |
Thunderbird 1.5.0.4 (Windows/20060516) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
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.
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>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFErcpYLD1OTBfyMaQRAqxOAJ9lCexMy7yOl6NjG4FZxNyXkF9ZxACfVuV3
3gIDD2Ktgw0zns+jmeEGN7w=
=wtHp
-----END PGP SIGNATURE-----
--- 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);
- getaddrinfo.c on windows,
Derek R. Price <=