diff --git a/src/include/lwip/if_api.h b/src/include/lwip/if_api.h index 007cf4d6..39017abd 100644 --- a/src/include/lwip/if_api.h +++ b/src/include/lwip/if_api.h @@ -40,8 +40,15 @@ #define LWIP_HDR_IF_H #include "lwip/opt.h" + +#if LWIP_SOCKET /* don't build if not configured for use in lwipopts.h */ + #include "lwip/netif.h" +#ifdef __cplusplus +extern "C" { +#endif + #define IF_NAMESIZE NETIF_NAMESIZE char * lwip_if_indextoname(unsigned int ifindex, char *ifname); @@ -52,4 +59,10 @@ unsigned int lwip_if_nametoindex(const char *ifname); #define if_nametoindex(ifname) lwip_if_nametoindex(ifname) #endif /* LWIP_COMPAT_SOCKETS */ +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_SOCKET */ + #endif /* LWIP_HDR_IF_H */