From e194df75dddc04983c4e523e8f5e8a4aadda97d2 Mon Sep 17 00:00:00 2001 From: Sebastian Michel Date: Thu, 4 Jan 2024 08:31:28 +0100 Subject: [PATCH] contrib: fixed c++ compatibility of unix port --- contrib/ports/unix/port/include/arch/cc.h | 8 ++++++++ contrib/ports/unix/port/include/arch/perf.h | 8 ++++++++ contrib/ports/unix/port/include/arch/sys_arch.h | 8 ++++++++ contrib/ports/unix/port/include/netif/fifo.h | 8 ++++++++ contrib/ports/unix/port/include/netif/list.h | 8 ++++++++ contrib/ports/unix/port/include/netif/pcapif.h | 8 ++++++++ contrib/ports/unix/port/include/netif/sio.h | 8 ++++++++ contrib/ports/unix/port/include/netif/tapif.h | 8 ++++++++ contrib/ports/unix/port/include/netif/vdeif.h | 8 ++++++++ 9 files changed, 72 insertions(+) diff --git a/contrib/ports/unix/port/include/arch/cc.h b/contrib/ports/unix/port/include/arch/cc.h index 7be900bf8..c4b51b672 100644 --- a/contrib/ports/unix/port/include/arch/cc.h +++ b/contrib/ports/unix/port/include/arch/cc.h @@ -52,6 +52,10 @@ #define LWIP_TIMEVAL_PRIVATE 0 #include +#ifdef __cplusplus +extern "C" { +#endif + #define LWIP_ERRNO_INCLUDE #if defined(LWIP_UNIX_LINUX) || defined(LWIP_UNIX_HURD) || defined(LWIP_UNIX_KFREEBSD) @@ -86,4 +90,8 @@ typedef struct sio_status_s sio_status_t; typedef unsigned int sys_prot_t; +#ifdef __cplusplus +} +#endif + #endif /* LWIP_ARCH_CC_H */ diff --git a/contrib/ports/unix/port/include/arch/perf.h b/contrib/ports/unix/port/include/arch/perf.h index 364f31648..112a34789 100644 --- a/contrib/ports/unix/port/include/arch/perf.h +++ b/contrib/ports/unix/port/include/arch/perf.h @@ -34,6 +34,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #ifdef PERF #define PERF_START { \ unsigned long __c1l, __c1h, __c2l, __c2h; \ @@ -60,4 +64,8 @@ void perf_print_times(struct tms *start, struct tms *end, char *key); void perf_init(char *fname); +#ifdef __cplusplus +} +#endif + #endif /* LWIP_ARCH_PERF_H */ diff --git a/contrib/ports/unix/port/include/arch/sys_arch.h b/contrib/ports/unix/port/include/arch/sys_arch.h index 567e1256a..eb6d1d3e1 100644 --- a/contrib/ports/unix/port/include/arch/sys_arch.h +++ b/contrib/ports/unix/port/include/arch/sys_arch.h @@ -32,6 +32,10 @@ #ifndef LWIP_ARCH_SYS_ARCH_H #define LWIP_ARCH_SYS_ARCH_H +#ifdef __cplusplus +extern "C" { +#endif + #define SYS_MBOX_NULL NULL #define SYS_SEM_NULL NULL @@ -87,4 +91,8 @@ void sys_unlock_tcpip_core(void); #define UNLOCK_TCPIP_CORE() sys_unlock_tcpip_core() #endif +#ifdef __cplusplus +} +#endif + #endif /* LWIP_ARCH_SYS_ARCH_H */ diff --git a/contrib/ports/unix/port/include/netif/fifo.h b/contrib/ports/unix/port/include/netif/fifo.h index bda352a7b..7c87c8292 100644 --- a/contrib/ports/unix/port/include/netif/fifo.h +++ b/contrib/ports/unix/port/include/netif/fifo.h @@ -3,6 +3,10 @@ #include "lwip/sys.h" +#ifdef __cplusplus +extern "C" { +#endif + /** How many bytes in fifo */ #define FIFOSIZE 2048 @@ -50,5 +54,9 @@ void fifoPut(fifo_t * fifo, int fd); */ void fifoInit(fifo_t * fifo); +#ifdef __cplusplus +} +#endif + #endif diff --git a/contrib/ports/unix/port/include/netif/list.h b/contrib/ports/unix/port/include/netif/list.h index 2c4d142a5..8c0fe2563 100644 --- a/contrib/ports/unix/port/include/netif/list.h +++ b/contrib/ports/unix/port/include/netif/list.h @@ -2,6 +2,10 @@ #ifndef LWIP_LIST_H #define LWIP_LIST_H +#ifdef __cplusplus +extern "C" { +#endif + struct elem; struct list { @@ -23,4 +27,8 @@ void list_delete(struct list *list); int list_remove(struct list *list, void *elem); void list_map(struct list *list, void (* func)(void *arg)); +#ifdef __cplusplus +} +#endif + #endif diff --git a/contrib/ports/unix/port/include/netif/pcapif.h b/contrib/ports/unix/port/include/netif/pcapif.h index ef7abd5f7..a9e197207 100644 --- a/contrib/ports/unix/port/include/netif/pcapif.h +++ b/contrib/ports/unix/port/include/netif/pcapif.h @@ -34,6 +34,14 @@ #include "lwip/netif.h" +#ifdef __cplusplus +extern "C" { +#endif + err_t pcapif_init(struct netif *netif); +#ifdef __cplusplus +} +#endif + #endif /* LWIP_PCAPIF_H */ diff --git a/contrib/ports/unix/port/include/netif/sio.h b/contrib/ports/unix/port/include/netif/sio.h index b9ff131b7..cb992f861 100644 --- a/contrib/ports/unix/port/include/netif/sio.h +++ b/contrib/ports/unix/port/include/netif/sio.h @@ -6,6 +6,10 @@ #include "netif/fifo.h" /*#include "netif/pppif.h"*/ +#ifdef __cplusplus +extern "C" { +#endif + struct sio_status_s { int fd; fifo_t myfifo; @@ -56,5 +60,9 @@ void sio_flush( sio_status_t * siostat ); */ void sio_change_baud( sioBaudrates baud, sio_status_t * siostat ); +#ifdef __cplusplus +} +#endif + #endif diff --git a/contrib/ports/unix/port/include/netif/tapif.h b/contrib/ports/unix/port/include/netif/tapif.h index 4c0fa6b30..c156e1db2 100644 --- a/contrib/ports/unix/port/include/netif/tapif.h +++ b/contrib/ports/unix/port/include/netif/tapif.h @@ -34,10 +34,18 @@ #include "lwip/netif.h" +#ifdef __cplusplus +extern "C" { +#endif + err_t tapif_init(struct netif *netif); void tapif_poll(struct netif *netif); #if NO_SYS int tapif_select(struct netif *netif); #endif /* NO_SYS */ +#ifdef __cplusplus +} +#endif + #endif /* LWIP_TAPIF_H */ diff --git a/contrib/ports/unix/port/include/netif/vdeif.h b/contrib/ports/unix/port/include/netif/vdeif.h index 01df2d147..e31839246 100644 --- a/contrib/ports/unix/port/include/netif/vdeif.h +++ b/contrib/ports/unix/port/include/netif/vdeif.h @@ -34,10 +34,18 @@ #include "lwip/netif.h" +#ifdef __cplusplus +extern "C" { +#endif + err_t vdeif_init(struct netif *netif); void vdeif_poll(struct netif *netif); #if NO_SYS int vdeif_select(struct netif *netif); #endif /* NO_SYS */ +#ifdef __cplusplus +} +#endif + #endif /* LWIP_VDEIF_H */