zephyr: Fix more C++ linkage

This commit is contained in:
Juliusz Sosinowicz
2026-01-09 13:43:16 +01:00
parent d98bbf1bc4
commit b6f0139d63
3 changed files with 32 additions and 2 deletions

View File

@@ -2594,6 +2594,10 @@ extern void uITRON4_free(void *p) ;
#endif /*(WOLFSSL_APACHE_MYNEWT)*/
#ifdef WOLFSSL_ZEPHYR
#ifdef __cplusplus
} /* extern "C" */
#endif
#include <version.h>
#if KERNEL_VERSION_NUMBER >= 0x30100
#include <zephyr/kernel.h>
@@ -2606,6 +2610,10 @@ extern void uITRON4_free(void *p) ;
#endif
#include <stdlib.h>
#ifdef __cplusplus
extern "C" {
#endif
#define WOLFSSL_DH_CONST
#define NO_WRITEV
#define NO_STDLIB_ISASCII

View File

@@ -283,8 +283,6 @@
#elif defined(WOLFSSL_APACHE_MYNEWT)
/* do nothing */
#elif defined(WOLFSSL_ZEPHYR)
/* Zephyr SDK can use a cpp compiler which will cause
* problems with extern "C" linkage if not handled */
#ifdef __cplusplus
} /* extern "C" */
#endif
@@ -994,8 +992,16 @@ WOLFSSL_ABI WOLFSSL_API int wolfCrypt_Cleanup(void);
#define XFGETS(b,s,f) -2 /* Not ported yet */
#elif defined(WOLFSSL_ZEPHYR)
#ifdef __cplusplus
} /* extern "C" */
#endif
#include <zephyr/fs/fs.h>
#ifdef __cplusplus
extern "C" {
#endif
#define XFILE struct fs_file_t*
/* These are our wrappers for opening and closing files to
@@ -1481,6 +1487,10 @@ WOLFSSL_ABI WOLFSSL_API int wolfCrypt_Cleanup(void);
#define USE_WOLF_TIME_T
#elif defined(WOLFSSL_ZEPHYR)
#ifdef __cplusplus
} /* extern "C" */
#endif
#include <version.h>
#ifndef _POSIX_C_SOURCE
#if KERNEL_VERSION_NUMBER >= 0x30100
@@ -1500,6 +1510,10 @@ WOLFSSL_ABI WOLFSSL_API int wolfCrypt_Cleanup(void);
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
time_t z_time(time_t *timer);
#define XTIME(tl) z_time((tl))

View File

@@ -176,6 +176,10 @@
#include <lwip-socket.h>
#include <errno.h>
#elif defined(WOLFSSL_ZEPHYR)
#ifdef __cplusplus
} /* extern "C" */
#endif
#include <version.h>
#if KERNEL_VERSION_NUMBER >= 0x30100
#include <zephyr/net/socket.h>
@@ -188,6 +192,10 @@
#include <posix/sys/socket.h>
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
#elif defined(MICROCHIP_PIC32)
#include <sys/errno.h>
#elif defined(HAVE_NETX)