diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index 2f916b2c0..e482bfb93 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -2605,7 +2605,6 @@ extern void uITRON4_free(void *p) ; #include #define WOLFSSL_DH_CONST - #define WOLFSSL_HAVE_MAX #define NO_WRITEV #define NO_STDLIB_ISASCII @@ -2616,7 +2615,6 @@ extern void uITRON4_free(void *p) ; void *z_realloc(void *ptr, size_t size); #define realloc z_realloc - #define max MAX #if !defined(CONFIG_NET_SOCKETS_POSIX_NAMES) && !defined(CONFIG_POSIX_API) #define CONFIG_NET_SOCKETS_POSIX_NAMES diff --git a/wolfssl/wolfcrypt/wc_port.h b/wolfssl/wolfcrypt/wc_port.h index e8fbc52b6..d9d97f308 100644 --- a/wolfssl/wolfcrypt/wc_port.h +++ b/wolfssl/wolfcrypt/wc_port.h @@ -283,24 +283,30 @@ #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 + #include #ifndef SINGLE_THREADED #if !defined(CONFIG_PTHREAD_IPC) && !defined(CONFIG_POSIX_THREADS) #error "Threading needs CONFIG_PTHREAD_IPC / CONFIG_POSIX_THREADS" #endif - #ifdef max - #undef max + #if KERNEL_VERSION_NUMBER >= 0x30100 + #include + #include + #include + #else + #include + #include + #include + #endif #endif - #if KERNEL_VERSION_NUMBER >= 0x30100 - #include - #include - #include - #else - #include - #include - #include - #endif - #define max MAX + + #ifdef __cplusplus + extern "C" { #endif #elif defined(WOLFSSL_TELIT_M2MB)