mirror of
https://github.com/wangyu-/udp2raw.git
synced 2025-02-07 23:59:36 +08:00
fix compile on windows again
This commit is contained in:
parent
4e4a77ce16
commit
a9bb76d6e8
@ -399,12 +399,12 @@ int inet_pton(int af, const char *src, void *dst)
|
|||||||
{
|
{
|
||||||
struct sockaddr_storage ss;
|
struct sockaddr_storage ss;
|
||||||
int size = sizeof(ss);
|
int size = sizeof(ss);
|
||||||
char src_copy[INET6_ADDRSTRLEN+1];
|
char src_copy[max_addr_len+1];
|
||||||
|
|
||||||
ZeroMemory(&ss, sizeof(ss));
|
ZeroMemory(&ss, sizeof(ss));
|
||||||
/* stupid non-const API */
|
/* stupid non-const API */
|
||||||
strncpy (src_copy, src, INET6_ADDRSTRLEN+1);
|
strncpy (src_copy, src, max_addr_len+1);
|
||||||
src_copy[INET6_ADDRSTRLEN] = 0;
|
src_copy[max_addr_len] = 0;
|
||||||
|
|
||||||
if (WSAStringToAddress(src_copy, af, NULL, (struct sockaddr *)&ss, &size) == 0) {
|
if (WSAStringToAddress(src_copy, af, NULL, (struct sockaddr *)&ss, &size) == 0) {
|
||||||
switch(af) {
|
switch(af) {
|
||||||
|
2
common.h
2
common.h
@ -39,7 +39,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <my_ev.h>
|
#include <my_ev.h>
|
||||||
#include <netinet/in.h>
|
|
||||||
|
|
||||||
#if defined(__MINGW32__)
|
#if defined(__MINGW32__)
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
@ -54,6 +53,7 @@ typedef int socklen_t;
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user