File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -186,6 +186,13 @@ if(CONFIG_WOLFSSL)
186186
187187 target_compile_definitions (wolfSSL INTERFACE WOLFSSL_ZEPHYR)
188188 target_compile_definitions (wolfSSL INTERFACE WOLFSSL_USER_SETTINGS)
189+
190+ # Zephyr >= 4.1 provides min()/max() macros in sys/util.h that collide
191+ # with wolfSSL's static inline definitions in misc.c
192+ if (KERNEL_VERSION_MAJOR GREATER_EQUAL 5 OR
193+ (KERNEL_VERSION_MAJOR EQUAL 4 AND KERNEL_VERSION_MINOR GREATER_EQUAL 1))
194+ target_compile_definitions (wolfSSL INTERFACE WOLFSSL_HAVE_MIN_MAX)
195+ endif ()
189196 if (CONFIG_WOLFSSL_DEBUG)
190197 target_compile_definitions (wolfSSL INTERFACE DEBUG_WOLFSSL)
191198 zephyr_library_compile_options(-g3 -O0)
Original file line number Diff line number Diff line change @@ -40,8 +40,10 @@ extern "C" {
4040/* ------------------------------------------------------------------------- */
4141/* Platform */
4242/* ------------------------------------------------------------------------- */
43+ #ifdef WOLFSSL_HAVE_MIN_MAX
4344#define WOLFSSL_HAVE_MIN /* Zephyr provides min() in sys/util.h */
4445#define WOLFSSL_HAVE_MAX /* Zephyr provides max() in sys/util.h */
46+ #endif
4547#define WOLFSSL_GENERAL_ALIGNMENT 4 /* platform requires 32-bit alignment on uint32_t */
4648#define SIZEOF_LONG_LONG 8 /* long long is 8 bytes / 64-bit */
4749//#define WOLFSSL_NO_ASM /* optionally disable inline assembly support */
You can’t perform that action at this time.
0 commit comments