diff --git a/src/cli/cli_console.cpp b/src/cli/cli_console.cpp index 4f90209bb..ab626b5e4 100644 --- a/src/cli/cli_console.cpp +++ b/src/cli/cli_console.cpp @@ -45,7 +45,7 @@ namespace ot { namespace Cli { -static otDEFINE_ALIGNED_VAR(sCliConsoleRaw, sizeof(Console), uint64_t); +static OT_DEFINE_ALIGNED_VAR(sCliConsoleRaw, sizeof(Console), uint64_t); extern "C" void otCliConsoleInit(otInstance *aInstance, otCliConsoleOutputCallback aCallback, void *aContext) { diff --git a/src/cli/cli_uart.cpp b/src/cli/cli_uart.cpp index 327150fee..b4bdc0b2c 100644 --- a/src/cli/cli_uart.cpp +++ b/src/cli/cli_uart.cpp @@ -99,7 +99,7 @@ OT_STATIC_ASSERT(OPENTHREAD_CONFIG_CLI_MAX_LINE_LENGTH <= OPENTHREAD_CONFIG_CLI_ namespace ot { namespace Cli { -static otDEFINE_ALIGNED_VAR(sCliUartRaw, sizeof(Uart), uint64_t); +static OT_DEFINE_ALIGNED_VAR(sCliUartRaw, sizeof(Uart), uint64_t); extern "C" void otCliUartInit(otInstance *aInstance) { diff --git a/src/core/coap/coap_message.hpp b/src/core/coap/coap_message.hpp index 052cba509..5f110dfe9 100644 --- a/src/core/coap/coap_message.hpp +++ b/src/core/coap/coap_message.hpp @@ -598,7 +598,7 @@ private: OT_STATIC_ASSERT(sizeof(mBuffer.mHead.mInfo) + sizeof(HelpData) + kHelpDataAlignment <= sizeof(mBuffer), "Insufficient buffer size for CoAP processing!"); - return *static_cast(otALIGN(mBuffer.mHead.mData, kHelpDataAlignment)); + return *static_cast(OT_ALIGN(mBuffer.mHead.mData, kHelpDataAlignment)); } HelpData &GetHelpData(void) { return const_cast(static_cast(this)->GetHelpData()); } diff --git a/src/core/common/code_utils.hpp b/src/core/common/code_utils.hpp index 1751190bc..82e386936 100644 --- a/src/core/common/code_utils.hpp +++ b/src/core/common/code_utils.hpp @@ -72,14 +72,14 @@ * @returns The aligned pointer. * */ -#define otALIGN(aPointer, aAlignment) \ +#define OT_ALIGN(aPointer, aAlignment) \ ((void *)(((uintptr_t)(aPointer) + (aAlignment)-1UL) & ~((uintptr_t)(aAlignment)-1UL))) // Calculates the aligned variable size. -#define otALIGNED_VAR_SIZE(size, align_type) (((size) + (sizeof(align_type) - 1)) / sizeof(align_type)) +#define OT_ALIGNED_VAR_SIZE(size, align_type) (((size) + (sizeof(align_type) - 1)) / sizeof(align_type)) // Allocate the structure using "raw" storage. -#define otDEFINE_ALIGNED_VAR(name, size, align_type) \ +#define OT_DEFINE_ALIGNED_VAR(name, size, align_type) \ align_type name[(((size) + (sizeof(align_type) - 1)) / sizeof(align_type))] /** diff --git a/src/core/common/extension_example.cpp b/src/core/common/extension_example.cpp index 15c13a888..833b0cef3 100644 --- a/src/core/common/extension_example.cpp +++ b/src/core/common/extension_example.cpp @@ -62,7 +62,7 @@ public: // `ExtensionBase` API // ---------------------------------------------------------------------------- -static otDEFINE_ALIGNED_VAR(sExtensionRaw, sizeof(Extension), uint64_t); +static OT_DEFINE_ALIGNED_VAR(sExtensionRaw, sizeof(Extension), uint64_t); ExtensionBase &ExtensionBase::Init(Instance &aInstance) { diff --git a/src/core/common/instance.cpp b/src/core/common/instance.cpp index ed9448d05..f18fd99a7 100644 --- a/src/core/common/instance.cpp +++ b/src/core/common/instance.cpp @@ -44,7 +44,7 @@ namespace ot { #if !OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE // Define the raw storage used for OpenThread instance (in single-instance case). -otDEFINE_ALIGNED_VAR(gInstanceRaw, sizeof(Instance), uint64_t); +OT_DEFINE_ALIGNED_VAR(gInstanceRaw, sizeof(Instance), uint64_t); #endif diff --git a/src/ncp/ncp_spi.cpp b/src/ncp/ncp_spi.cpp index 313647979..d3b78299f 100644 --- a/src/ncp/ncp_spi.cpp +++ b/src/ncp/ncp_spi.cpp @@ -60,7 +60,7 @@ namespace Ncp { #if OPENTHREAD_ENABLE_NCP_VENDOR_HOOK == 0 -static otDEFINE_ALIGNED_VAR(sNcpRaw, sizeof(NcpSpi), uint64_t); +static OT_DEFINE_ALIGNED_VAR(sNcpRaw, sizeof(NcpSpi), uint64_t); extern "C" void otNcpInit(otInstance *aInstance) { diff --git a/src/ncp/ncp_uart.cpp b/src/ncp/ncp_uart.cpp index 8c70c14b8..60f27f01f 100644 --- a/src/ncp/ncp_uart.cpp +++ b/src/ncp/ncp_uart.cpp @@ -64,7 +64,7 @@ namespace Ncp { #if OPENTHREAD_ENABLE_NCP_VENDOR_HOOK == 0 -static otDEFINE_ALIGNED_VAR(sNcpRaw, sizeof(NcpUart), uint64_t); +static OT_DEFINE_ALIGNED_VAR(sNcpRaw, sizeof(NcpUart), uint64_t); extern "C" void otNcpInit(otInstance *aInstance) {