[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.
This commit is contained in:
Abtin Keshavarzian
2023-12-12 17:39:02 -08:00
committed by GitHub
parent fd02db638e
commit a62e238b7f
+2 -2
View File
@@ -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 *)