api: shorten function checks (and put each into a different scope)
[libc-test] / src / api / arpa_inet.c
index 52b013a..afbfca1 100644 (file)
@@ -15,26 +15,26 @@ C(INET6_ADDRSTRLEN)
 #ifdef htonl
 C(htonl(0))
 #else
-uint32_t(*p_htonl)(uint32_t) = htonl;
+{uint32_t(*p)(uint32_t) = htonl;}
 #endif
 #ifdef htons
 C(htons(0))
 #else
-uint16_t(*p_htons)(uint16_t) = htons;
+{uint16_t(*p)(uint16_t) = htons;}
 #endif
 #ifdef ntohl
 C(ntohl(0))
 #else
-uint32_t(*p_ntohl)(uint32_t) = ntohl;
+{uint32_t(*p)(uint32_t) = ntohl;}
 #endif
 #ifdef ntohs
 C(ntohs(0))
 #else
-uint16_t(*p_ntohs)(uint16_t) = ntohs;
+{uint16_t(*p)(uint16_t) = ntohs;}
 #endif
 
-in_addr_t(*p_inet_addr)(const char*) = inet_addr;
-char*(*p_inet_ntoa)(struct in_addr) = inet_ntoa;
-const char*(*p_inet_ntop)(int,const void*restrict,char*restrict,socklen_t) = inet_ntop;
-int(*p_inet_pton)(int,const char*restrict,void*restrict) = inet_pton;
+{in_addr_t(*p)(const char*) = inet_addr;}
+{char*(*p)(struct in_addr) = inet_ntoa;}
+{const char*(*p)(int,const void*restrict,char*restrict,socklen_t) = inet_ntop;}
+{int(*p)(int,const char*restrict,void*restrict) = inet_pton;}
 }