contrib: fixed c++ compatibility of unix port

This commit is contained in:
Sebastian Michel 2024-01-04 08:31:28 +01:00 committed by goldsimon
parent 347054b329
commit e1b8080346
9 changed files with 72 additions and 0 deletions

View File

@ -52,6 +52,10 @@
#define LWIP_TIMEVAL_PRIVATE 0
#include <sys/time.h>
#ifdef __cplusplus
extern "C" {
#endif
#define LWIP_ERRNO_INCLUDE <errno.h>
#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 */

View File

@ -34,6 +34,10 @@
#include <sys/times.h>
#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 */

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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