@@ -2052,9 +2052,17 @@ extern void uITRON4_free(void *p) ;
20522052 #include "RTOS.h"
20532053 #if !defined(XMALLOC_USER ) && !defined(NO_WOLFSSL_MEMORY ) && \
20542054 !defined(WOLFSSL_STATIC_MEMORY )
2055- #define XMALLOC (s , h , type ) ((void)(h), (void)(type), OS_HEAP_malloc((s)))
2056- #define XFREE (p , h , type ) ((void)(h), (void)(type), OS_HEAP_free((p)))
2057- #define XREALLOC (p , n , h , t ) ((void)(h), (void)(t), OS_HEAP_realloc(((p), (n)))
2055+ /* Per the user manual of embOS https://www.segger.com/downloads/embos/UM01001
2056+ this API has changed with V5. */
2057+ #if (OS_VERSION >= 50000U )
2058+ #define XMALLOC (s , h , type ) ((void)(h), (void)(type), OS_HEAP_malloc((s)))
2059+ #define XFREE (p , h , type ) ((void)(h), (void)(type), OS_HEAP_free((p)))
2060+ #define XREALLOC (p , n , h , t ) ((void)(h), (void)(t), OS_HEAP_realloc((p), (n)))
2061+ #else
2062+ #define XMALLOC (s , h , type ) ((void)(h), (void)(type), OS_malloc((s)))
2063+ #define XFREE (p , h , type ) ((void)(h), (void)(type), OS_free((p)))
2064+ #define XREALLOC (p , n , h , t ) ((void)(h), (void)(t), OS_realloc((p), (n)))
2065+ #endif
20582066 #endif
20592067#endif
20602068
0 commit comments