Mercurial > vim
comparison src/channel.c @ 20577:5f0f1f63c8df v8.2.0842
patch 8.2.0842: MS-Windows: channel tests fail
Commit: https://github.com/vim/vim/commit/208534d9ae6e8dec5baff90440b58c63f0b37981
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat May 30 13:07:39 2020 +0200
patch 8.2.0842: MS-Windows: channel tests fail
Problem: MS-Windows: channel tests fail.
Solution: Adjust #ifdefs. (closes https://github.com/vim/vim/issues/6162)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 30 May 2020 13:15:03 +0200 |
parents | 5e86e00fa712 |
children | d9a2e5dcfd9f |
comparison
equal
deleted
inserted
replaced
20576:dbb4a66f4ef4 | 20577:5f0f1f63c8df |
---|---|
1000 { | 1000 { |
1001 const char *dst = hostname; | 1001 const char *dst = hostname; |
1002 # ifdef HAVE_INET_NTOP | 1002 # ifdef HAVE_INET_NTOP |
1003 const void *src = NULL; | 1003 const void *src = NULL; |
1004 char buf[NUMBUFLEN]; | 1004 char buf[NUMBUFLEN]; |
1005 # endif | |
1005 | 1006 |
1006 if (addr->ai_family == AF_INET6) | 1007 if (addr->ai_family == AF_INET6) |
1007 { | 1008 { |
1008 struct sockaddr_in6 *sai = (struct sockaddr_in6 *)addr->ai_addr; | 1009 struct sockaddr_in6 *sai = (struct sockaddr_in6 *)addr->ai_addr; |
1009 | 1010 |
1010 sai->sin6_port = htons(port); | 1011 sai->sin6_port = htons(port); |
1012 # ifdef HAVE_INET_NTOP | |
1011 src = &sai->sin6_addr; | 1013 src = &sai->sin6_addr; |
1014 # endif | |
1012 } | 1015 } |
1013 else if (addr->ai_family == AF_INET) | 1016 else if (addr->ai_family == AF_INET) |
1014 { | 1017 { |
1015 struct sockaddr_in *sai = (struct sockaddr_in *)addr->ai_addr; | 1018 struct sockaddr_in *sai = (struct sockaddr_in *)addr->ai_addr; |
1016 | 1019 |
1017 sai->sin_port = htons(port); | 1020 sai->sin_port = htons(port); |
1021 # ifdef HAVE_INET_NTOP | |
1018 src = &sai->sin_addr; | 1022 src = &sai->sin_addr; |
1019 } | 1023 #endif |
1024 } | |
1025 # ifdef HAVE_INET_NTOP | |
1020 if (src != NULL) | 1026 if (src != NULL) |
1021 { | 1027 { |
1022 dst = inet_ntop(addr->ai_family, src, buf, sizeof(buf)); | 1028 dst = inet_ntop(addr->ai_family, src, buf, sizeof(buf)); |
1023 if (dst == NULL) | 1029 if (dst == NULL) |
1024 dst = hostname; | 1030 dst = hostname; |