Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ca9b323

Browse files
committed
better test for existence of hstrerror()
1 parent a6a1e53 commit ca9b323

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Modules/socketmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ BUILD_FUNC_DEF_2(setipaddr, char*,name, struct sockaddr_in *,addr_ret)
265265
#endif /* HAVE_GETHOSTBYNAME_R */
266266

267267
if (hp == NULL) {
268-
#ifndef NT
268+
#ifdef HAVE_HSTRERROR
269269
/* Let's get real error message to return */
270270
extern int h_errno;
271271
PyErr_SetString(PySocket_Error, (char *)hstrerror(h_errno));
@@ -1026,7 +1026,7 @@ BUILD_FUNC_DEF_2(PySocket_gethostbyaddr,PyObject *,self, PyObject *, args)
10261026
sizeof(addr.sin_addr),
10271027
AF_INET);
10281028
if (h == NULL) {
1029-
#ifndef NT
1029+
#ifdef HAVE_HSTRERROR
10301030
/* Let's get real error message to return */
10311031
extern int h_errno;
10321032
PyErr_SetString(PySocket_Error, (char *)hstrerror(h_errno));

0 commit comments

Comments
 (0)