]> xenbits.xensource.com Git - unikraft/libs/lwip.git/commitdiff
Further protect gethostbyname* defines
authorMihai Pogonaru <pogonarumihai@gmail.com>
Sat, 29 Jun 2019 13:55:01 +0000 (16:55 +0300)
committerFelipe Huici <felipe.huici@neclab.eu>
Sat, 29 Jun 2019 14:43:17 +0000 (16:43 +0200)
lwip_gethostbyname and lwip_gethostbyname_r definitions are protected
by LWIP_DNS && LWIP_SOCKET

Signed-off-by: Mihai Pogonaru <pogonarumihai@gmail.com>
Reviewed-by: Costin Lupu <costin.lupu@cs.pub.ro>
include/netdb.h

index bf5edff261086a573c4957a6bb50ced2e5af024a..dbed0cd31ecd4d416d4728126c563d12554e5000 100644 (file)
@@ -1,12 +1,12 @@
-#if !(LWIP_COMPAT_SOCKETS)
+#include <compat/posix/netdb.h>
+
+#if LWIP_DNS && LWIP_SOCKET && !(LWIP_COMPAT_SOCKETS)
 
 #define gethostbyname(name) lwip_gethostbyname(name)
 #define gethostbyname_r(name, ret, buf, buflen, result, h_errnop) \
        lwip_gethostbyname_r(name, ret, buf, buflen, result, h_errnop)
 
-#endif /* !(LWIP_COMPAT_SOCKETS) */
-
-#include <compat/posix/netdb.h>
+#endif /* LWIP_DNS && LWIP_SOCKET && !(LWIP_COMPAT_SOCKETS) */
 
 struct servent {
        char    *s_name;        /* official service name */