Skip to content

Commit fe36fc9

Browse files
committed
Before declaring h_errno, do not check for Win32 only. Instead, do check
whether h_errno is a macro.
1 parent 4c81d60 commit fe36fc9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Modules/getaddrinfo.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ get_addr(hostname, af, res, pai, port0)
544544
struct gai_afd *gai_afd;
545545
int i, error = 0, h_error;
546546
char *ap;
547-
#if !defined(INET6) && !defined(MS_WIN32)
547+
#if !defined(INET6) && !defined(h_errno)
548548
/* In winsock.h, h_errno is #defined as a function call. */
549549
extern int h_errno;
550550
#endif

Modules/socketmodule.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1789,7 +1789,7 @@ gethost_common(struct hostent *h, struct sockaddr *addr, int alen, int af)
17891789

17901790
if (h == NULL) {
17911791
/* Let's get real error message to return */
1792-
#ifndef MS_WIN32
1792+
#ifndef h_errno
17931793
extern int h_errno;
17941794
#endif
17951795
PyH_Err(h_errno);

0 commit comments

Comments
 (0)