mirror of
https://github.com/espressif/openthread.git
synced 2026-07-16 17:14:09 +00:00
[style] harmonize feature check and header includes (#6399)
This commit harmonizes how the feature config checks are done within OT core modules. In header `.hpp` files, any related `#if` config check is done immediately after the `"openthread-core-config.h"` is included. This way the rest of definitions are skipped over if the feature is not being used. In `cpp` source files the `#if` check is done immediately after including the related header file.
This commit is contained in:
committed by
GitHub
parent
29f6f275b8
commit
743e91361c
@@ -33,6 +33,8 @@
|
||||
|
||||
#include "openthread-core-config.h"
|
||||
|
||||
#if OPENTHREAD_FTD || OPENTHREAD_MTD
|
||||
|
||||
#include <openthread/thread.h>
|
||||
|
||||
#include "common/debug.hpp"
|
||||
@@ -42,7 +44,6 @@
|
||||
|
||||
using namespace ot;
|
||||
|
||||
#if OPENTHREAD_FTD || OPENTHREAD_MTD
|
||||
uint32_t otThreadGetChildTimeout(otInstance *aInstance)
|
||||
{
|
||||
Instance &instance = *static_cast<Instance *>(aInstance);
|
||||
@@ -515,4 +516,5 @@ void otThreadRegisterParentResponseCallback(otInstance * aInst
|
||||
|
||||
instance.Get<Mle::MleRouter>().RegisterParentResponseStatsCallback(aCallback, aContext);
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_FTD || OPENTHREAD_MTD
|
||||
|
||||
Reference in New Issue
Block a user