Port getaddrinfo to MSVC++. · pythoncapi/cpython@d783041 · GitHub
Skip to content

Commit d783041

Browse files
committed
Port getaddrinfo to MSVC++.
1 parent 1bdd0f2 commit d783041

3 files changed

Lines changed: 15 additions & 15 deletions

File tree

Modules/addrinfo.h

Lines changed: 2 additions & 2 deletions

Modules/getaddrinfo.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,17 @@ static struct gai_afd {
117117
#define PTON_MAX 4
118118
#endif
119119

120+
#ifndef IN_MULTICAST
121+
#define IN_MULTICAST(i) (((i) & 0xf0000000U) == 0xe0000000U)
122+
#endif
123+
124+
#ifndef IN_EXPERIMENTAL
125+
#define IN_EXPERIMENTAL(i) (((i) & 0xe0000000U) == 0xe0000000U)
126+
#endif
127+
128+
#ifndef IN_LOOPBACKNET
129+
#define IN_LOOPBACKNET 127
130+
#endif
120131

121132
static int get_name Py_PROTO((const char *, struct gai_afd *,
122133
struct addrinfo **, char *, struct addrinfo *,
@@ -527,7 +538,8 @@ get_addr(hostname, af, res, pai, port0)
527538
struct gai_afd *gai_afd;
528539
int i, error = 0, h_error;
529540
char *ap;
530-
#ifndef INET6
541+
#if !defined(INET6) && !defined(MS_WIN32)
542+
/* In winsock.h, h_errno is #defined as a function call. */
531543
extern int h_errno;
532544
#endif
533545

Modules/socketmodule.c

Lines changed: 0 additions & 12 deletions

0 commit comments

Comments
 (0)