From a62e238b7f086a07737e3cb2f0c81c4f2831fd3c Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Tue, 12 Dec 2023 17:39:02 -0800 Subject: [PATCH] [unit-test] make sure `otPlatLog()` is defined as `extern "C"` (#9711) This ensures that the function defined in the unit test would be correctly picked over weak implementations. --- tests/unit/test_routing_manager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/test_routing_manager.cpp b/tests/unit/test_routing_manager.cpp index 39659c430..5f1ac2f96 100644 --- a/tests/unit/test_routing_manager.cpp +++ b/tests/unit/test_routing_manager.cpp @@ -227,6 +227,8 @@ void SendRouterAdvert(const Ip6::Address &aAddress, const Icmp6Packet &aP void SendNeighborAdvert(const Ip6::Address &aAddress, const Ip6::Nd::NeighborAdvertMessage &aNaMessage); void DiscoverNat64Prefix(const Ip6::Prefix &aPrefix); +extern "C" { + #if OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...) { @@ -246,8 +248,6 @@ void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat //---------------------------------------------------------------------------------------------------------------------- // `otPlatRadio -extern "C" { - otRadioCaps otPlatRadioGetCaps(otInstance *) { return OT_RADIO_CAPS_ACK_TIMEOUT | OT_RADIO_CAPS_CSMA_BACKOFF; } otError otPlatRadioTransmit(otInstance *, otRadioFrame *)