mirror of
https://github.com/espressif/openthread.git
synced 2026-07-30 23:57:47 +00:00
Add missing dependencies to "openthread-posix" target (#8801)
The `openthread-posix` library calls OT public APIs and library APIs (e.g. radio_spinel, HDLC), but it doesn't link against the library targets. This commit also adds `extern "C"` for posix impl of `otPlatFree` and `otPlatCAlloc`.
This commit is contained in:
@@ -135,6 +135,10 @@ target_link_libraries(openthread-posix
|
||||
PUBLIC
|
||||
openthread-platform
|
||||
PRIVATE
|
||||
openthread-cli-ftd
|
||||
openthread-ftd
|
||||
openthread-hdlc
|
||||
openthread-spinel-rcp
|
||||
openthread-url
|
||||
ot-config-ftd
|
||||
ot-config
|
||||
|
||||
@@ -34,7 +34,9 @@
|
||||
#include <openthread/platform/memory.h>
|
||||
|
||||
#if OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE
|
||||
extern "C" {
|
||||
void *otPlatCAlloc(size_t aNum, size_t aSize) { return calloc(aNum, aSize); }
|
||||
|
||||
void otPlatFree(void *aPtr) { free(aPtr); }
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user