Minor if_api.h cleanups

This commit makes the following minor cleanups:
  1) Add C++ support
  2) Guard header with #if LWIP_SOCKET
This commit is contained in:
Joel Cunningham 2017-02-09 22:48:47 -06:00
parent 3a7e03aaff
commit 2cab253b34

View File

@ -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 */