@@ -2123,9 +2123,17 @@ extern void uITRON4_free(void *p) ;
21232123 #include "RTOS.h"
21242124 #if !defined(XMALLOC_USER ) && !defined(NO_WOLFSSL_MEMORY ) && \
21252125 !defined(WOLFSSL_STATIC_MEMORY )
2126- #define XMALLOC (s , h , type ) ((void)(h), (void)(type), OS_HEAP_malloc((s)))
2127- #define XFREE (p , h , type ) ((void)(h), (void)(type), OS_HEAP_free((p)))
2128- #define XREALLOC (p , n , h , t ) ((void)(h), (void)(t), OS_HEAP_realloc(((p), (n)))
2126+ /* Per the user manual of embOS https://www.segger.com/downloads/embos/UM01001
2127+ * this API has changed with V5. */
2128+ #if (OS_VERSION >= 50000U )
2129+ #define XMALLOC (s , h , type ) ((void)(h), (void)(type), OS_HEAP_malloc((s)))
2130+ #define XFREE (p , h , type ) ((void)(h), (void)(type), OS_HEAP_free((p)))
2131+ #define XREALLOC (p , n , h , t ) ((void)(h), (void)(t), OS_HEAP_realloc((p), (n)))
2132+ #else
2133+ #define XMALLOC (s , h , type ) ((void)(h), (void)(type), OS_malloc((s)))
2134+ #define XFREE (p , h , type ) ((void)(h), (void)(type), OS_free((p)))
2135+ #define XREALLOC (p , n , h , t ) ((void)(h), (void)(t), OS_realloc((p), (n)))
2136+ #endif
21292137 #endif
21302138#endif
21312139
0 commit comments