1570af302Sopenharmony_ci#include <arpa/inet.h> 2570af302Sopenharmony_ci#define T(t) (t*)0; 3570af302Sopenharmony_ci#define C(n) switch(n){case n:;} 4570af302Sopenharmony_ci#define I(t,e) {t x[sizeof(t)==sizeof(e)] = {e};} 5570af302Sopenharmony_cistatic void f() 6570af302Sopenharmony_ci{ 7570af302Sopenharmony_ciT(in_port_t) 8570af302Sopenharmony_ciT(in_addr_t) 9570af302Sopenharmony_ciT(struct in_addr) 10570af302Sopenharmony_ciT(uint32_t) 11570af302Sopenharmony_ciT(uint16_t) 12570af302Sopenharmony_ci 13570af302Sopenharmony_ciC(INET_ADDRSTRLEN) 14570af302Sopenharmony_ciC(INET6_ADDRSTRLEN) 15570af302Sopenharmony_ci 16570af302Sopenharmony_ci#ifdef htonl 17570af302Sopenharmony_ciI(uint32_t, htonl(0LL)) 18570af302Sopenharmony_ci#else 19570af302Sopenharmony_ci{uint32_t(*p)(uint32_t) = htonl;} 20570af302Sopenharmony_ci#endif 21570af302Sopenharmony_ci#ifdef htons 22570af302Sopenharmony_ciI(uint16_t, htons(0LL)) 23570af302Sopenharmony_ci#else 24570af302Sopenharmony_ci{uint16_t(*p)(uint16_t) = htons;} 25570af302Sopenharmony_ci#endif 26570af302Sopenharmony_ci#ifdef ntohl 27570af302Sopenharmony_ciI(uint32_t, ntohl(0LL)) 28570af302Sopenharmony_ci#else 29570af302Sopenharmony_ci{uint32_t(*p)(uint32_t) = ntohl;} 30570af302Sopenharmony_ci#endif 31570af302Sopenharmony_ci#ifdef ntohs 32570af302Sopenharmony_ciI(uint16_t, ntohs(0LL)) 33570af302Sopenharmony_ci#else 34570af302Sopenharmony_ci{uint16_t(*p)(uint16_t) = ntohs;} 35570af302Sopenharmony_ci#endif 36570af302Sopenharmony_ci 37570af302Sopenharmony_ci{in_addr_t(*p)(const char*) = inet_addr;} 38570af302Sopenharmony_ci{char*(*p)(struct in_addr) = inet_ntoa;} 39570af302Sopenharmony_ci{const char*(*p)(int,const void*restrict,char*restrict,socklen_t) = inet_ntop;} 40570af302Sopenharmony_ci{int(*p)(int,const char*restrict,void*restrict) = inet_pton;} 41570af302Sopenharmony_ci} 42