-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwin_include.h
41 lines (35 loc) · 976 Bytes
/
win_include.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef WIN_INCLUDE_H
#define WIN_INCLUDE_H
#include <SDKDDKVer.h>
#if(_WIN32_WINNT < _WIN32_WINNT_WIN7)
#define _WIN32_WINNT _WIN32_WINNT_WINBLUE
#endif
#include <winsock.h>
#include <winsock2.h>
#include <windows.h>
#include <errno.h>
#include <ws2def.h>
#include <ws2tcpip.h>
#include <iphlpapi.h>
#include <stdio.h>
//int inet_pton(int af, const char *src, void *dst)
//{
// struct sockaddr_storage ss;
// int size = sizeof(ss);
// wchar_t src_copy[INET6_ADDRSTRLEN+1];
// mbstowcs(src_copy,src,INET6_ADDRSTRLEN+1);
// ZeroMemory(&ss, sizeof(ss));
// /* stupid non-const API */
// if (WSAStringToAddress( src_copy, af, NULL, (struct sockaddr *)&ss, &size) == 0) {
// switch(af) {
// case AF_INET:
// *(struct in_addr *)dst = ((struct sockaddr_in *)&ss)->sin_addr;
// return 1;
// case AF_INET6:
// *(struct in6_addr *)dst = ((struct sockaddr_in6 *)&ss)->sin6_addr;
// return 1;
// }
// }
// return 0;
//}
#endif // WIN_INCLUDE_H