52b013a119bc0cbbfc14dff8898c75dee9fb2b6e
[libc-test] / src / api / arpa_inet.c
1 #include <arpa/inet.h>
2 #define T(t) (t*)0;
3 #define C(n) switch(n){case n:;}
4 static void f()
5 {
6 T(in_port_t)
7 T(in_addr_t)
8 T(struct in_addr)
9 T(uint32_t)
10 T(uint16_t)
11
12 C(INET_ADDRSTRLEN)
13 C(INET6_ADDRSTRLEN)
14
15 #ifdef htonl
16 C(htonl(0))
17 #else
18 uint32_t(*p_htonl)(uint32_t) = htonl;
19 #endif
20 #ifdef htons
21 C(htons(0))
22 #else
23 uint16_t(*p_htons)(uint16_t) = htons;
24 #endif
25 #ifdef ntohl
26 C(ntohl(0))
27 #else
28 uint32_t(*p_ntohl)(uint32_t) = ntohl;
29 #endif
30 #ifdef ntohs
31 C(ntohs(0))
32 #else
33 uint16_t(*p_ntohs)(uint16_t) = ntohs;
34 #endif
35
36 in_addr_t(*p_inet_addr)(const char*) = inet_addr;
37 char*(*p_inet_ntoa)(struct in_addr) = inet_ntoa;
38 const char*(*p_inet_ntop)(int,const void*restrict,char*restrict,socklen_t) = inet_ntop;
39 int(*p_inet_pton)(int,const char*restrict,void*restrict) = inet_pton;
40 }