From 2cab253b34d6eec5826a51abdbfe306340adabad Mon Sep 17 00:00:00 2001 From: Joel Cunningham Date: Thu, 9 Feb 2017 22:48:47 -0600 Subject: [PATCH] Minor if_api.h cleanups This commit makes the following minor cleanups: 1) Add C++ support 2) Guard header with #if LWIP_SOCKET --- src/include/lwip/if_api.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 */