Skip to content

Commit

Permalink
contrib: fixed c++ compatibility of unix port
Browse files Browse the repository at this point in the history
  • Loading branch information
devzeb authored and goldsimon committed Feb 19, 2024
1 parent 347054b commit e1b8080
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 0 deletions.
8 changes: 8 additions & 0 deletions contrib/ports/unix/port/include/arch/cc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 */
8 changes: 8 additions & 0 deletions contrib/ports/unix/port/include/arch/perf.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@

#include <sys/times.h>

#ifdef __cplusplus
extern "C" {
#endif

#ifdef PERF
#define PERF_START { \
unsigned long __c1l, __c1h, __c2l, __c2h; \
Expand All @@ -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 */
8 changes: 8 additions & 0 deletions contrib/ports/unix/port/include/arch/sys_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 */
8 changes: 8 additions & 0 deletions contrib/ports/unix/port/include/netif/fifo.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

#include "lwip/sys.h"

#ifdef __cplusplus
extern "C" {
#endif

/** How many bytes in fifo */
#define FIFOSIZE 2048

Expand Down Expand Up @@ -50,5 +54,9 @@ void fifoPut(fifo_t * fifo, int fd);
*/
void fifoInit(fifo_t * fifo);

#ifdef __cplusplus
}
#endif

#endif

8 changes: 8 additions & 0 deletions contrib/ports/unix/port/include/netif/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
#ifndef LWIP_LIST_H
#define LWIP_LIST_H

#ifdef __cplusplus
extern "C" {
#endif

struct elem;

struct list {
Expand All @@ -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
8 changes: 8 additions & 0 deletions contrib/ports/unix/port/include/netif/pcapif.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
8 changes: 8 additions & 0 deletions contrib/ports/unix/port/include/netif/sio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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

8 changes: 8 additions & 0 deletions contrib/ports/unix/port/include/netif/tapif.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
8 changes: 8 additions & 0 deletions contrib/ports/unix/port/include/netif/vdeif.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit e1b8080

Please sign in to comment.