mirror of
https://github.com/espressif/openthread.git
synced 2026-09-01 06:49:54 +00:00
[posix-app] add posix config header file (#4510)
This commit updates how posix-app source files include the config header file to follow a similar policy as for core modules. All header files and `cpp` files that do not have a corresponding `hpp` file should include "openthread-posix-config.h" first (which itself will include the core config header). The "cpp" files which have a related "hpp" should include the related hpp file first. This way we ensure all config macro definitions are correctly included in all modules.
This commit is contained in:
committed by
Jonathan Hui
parent
50e094865b
commit
53b711e4f4
+1
-1
@@ -26,7 +26,7 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "openthread-core-config.h"
|
||||
#include "platform/openthread-posix-config.h"
|
||||
|
||||
#include <openthread/platform/toolchain.h>
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
#ifndef OPENTHREAD_CONSOLE_CLI_H_
|
||||
#define OPENTHREAD_CONSOLE_CLI_H_
|
||||
|
||||
#include "platform/openthread-posix-config.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "openthread-system.h"
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "platform/openthread-posix-config.h"
|
||||
|
||||
#include <openthread/config.h>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
@@ -58,6 +58,7 @@ libopenthread_posix_a_SOURCES = \
|
||||
$(NULL)
|
||||
|
||||
noinst_HEADERS = \
|
||||
openthread-posix-config.h \
|
||||
platform-posix.h \
|
||||
hdlc_interface.hpp \
|
||||
radio_spinel.hpp \
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "openthread-core-config.h"
|
||||
#include "openthread-posix-config.h"
|
||||
#include "platform-posix.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <openthread/platform/entropy.h>
|
||||
#include "openthread-posix-config.h"
|
||||
|
||||
#include "openthread-core-config.h"
|
||||
#include <openthread/platform/entropy.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -31,11 +31,10 @@
|
||||
* This file includes the implementation for the HDLC interface to radio (RCP).
|
||||
*/
|
||||
|
||||
#include "openthread-core-config.h"
|
||||
#include "platform-posix.h"
|
||||
|
||||
#include "hdlc_interface.hpp"
|
||||
|
||||
#include "platform-posix.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
@@ -34,7 +34,8 @@
|
||||
#ifndef POSIX_APP_HDLC_INTERFACE_HPP_
|
||||
#define POSIX_APP_HDLC_INTERFACE_HPP_
|
||||
|
||||
#include "platform-config.h"
|
||||
#include "openthread-posix-config.h"
|
||||
#include "platform-posix.h"
|
||||
#include "spinel_interface.hpp"
|
||||
#include "ncp/hdlc.hpp"
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "openthread-core-config.h"
|
||||
#include "openthread-posix-config.h"
|
||||
#include "platform-posix.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "openthread-core-config.h"
|
||||
#include "openthread-posix-config.h"
|
||||
#include "platform-posix.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
@@ -30,7 +30,8 @@
|
||||
* @file
|
||||
* This file implements the platform network on Linux.
|
||||
*/
|
||||
#include "openthread-core-config.h"
|
||||
|
||||
#include "openthread-posix-config.h"
|
||||
#include "platform-posix.h"
|
||||
|
||||
#include <arpa/inet.h>
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
#ifndef OPENTHREAD_PLATFORM_CONFIG_H_
|
||||
#define OPENTHREAD_PLATFORM_CONFIG_H_
|
||||
|
||||
#include "openthread-core-config.h"
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief
|
||||
@@ -35,6 +35,8 @@
|
||||
#ifndef PLATFORM_POSIX_H_
|
||||
#define PLATFORM_POSIX_H_
|
||||
|
||||
#include "openthread-posix-config.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@@ -45,7 +47,6 @@
|
||||
#include <openthread/error.h>
|
||||
#include <openthread/instance.h>
|
||||
|
||||
#include "platform-config.h"
|
||||
#include "common/logging.hpp"
|
||||
|
||||
/**
|
||||
|
||||
@@ -31,12 +31,11 @@
|
||||
* This file implements the spinel based radio transceiver.
|
||||
*/
|
||||
|
||||
#include "openthread-core-config.h"
|
||||
#include "radio_spinel.hpp"
|
||||
|
||||
#include "platform-posix.h"
|
||||
#include "ncp/spinel_decoder.hpp"
|
||||
|
||||
#include "radio_spinel.hpp"
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
#ifndef RADIO_SPINEL_HPP_
|
||||
#define RADIO_SPINEL_HPP_
|
||||
|
||||
#include "openthread-posix-config.h"
|
||||
|
||||
#include <openthread/platform/radio.h>
|
||||
|
||||
#if OPENTHREAD_POSIX_RCP_UART_ENABLE
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "openthread-core-config.h"
|
||||
#include "openthread-posix-config.h"
|
||||
#include "platform-posix.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
* This file implements the posix simulation.
|
||||
*/
|
||||
|
||||
#include "openthread-core-config.h"
|
||||
#include "openthread-posix-config.h"
|
||||
#include "platform-posix.h"
|
||||
|
||||
#include <arpa/inet.h>
|
||||
|
||||
@@ -31,10 +31,9 @@
|
||||
* This file includes the implementation for the SPI interface to radio (RCP).
|
||||
*/
|
||||
|
||||
#include "openthread-core-config.h"
|
||||
#include "spi_interface.hpp"
|
||||
|
||||
#include "platform-posix.h"
|
||||
#include "spi_interface.hpp"
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
#ifndef POSIX_APP_SPI_INTERFACE_HPP_
|
||||
#define POSIX_APP_SPI_INTERFACE_HPP_
|
||||
|
||||
#include "openthread-posix-config.h"
|
||||
|
||||
#include "spinel_interface.hpp"
|
||||
#include "ncp/hdlc.hpp"
|
||||
|
||||
@@ -164,7 +166,7 @@ private:
|
||||
kSpiTxRefuseExitCount = 100,
|
||||
kImmediateRetryCount = 5,
|
||||
kFastRetryCount = 15,
|
||||
kDebugBytesPerLine = 16,
|
||||
kDebugBytesPerLine = 16,
|
||||
kGpioIntAssertState = 0,
|
||||
kGpioResetAssertState = 0,
|
||||
};
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
#ifndef POSIX_APP_SPINEL_INTERFACE_HPP_
|
||||
#define POSIX_APP_SPINEL_INTERFACE_HPP_
|
||||
|
||||
#include "openthread-posix-config.h"
|
||||
|
||||
#include "ncp/hdlc.hpp"
|
||||
|
||||
namespace ot {
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
* This file includes the platform-specific initializers.
|
||||
*/
|
||||
|
||||
#include "openthread-core-config.h"
|
||||
#include "openthread-posix-config.h"
|
||||
#include "platform-posix.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "openthread-core-config.h"
|
||||
#include "openthread-posix-config.h"
|
||||
#include "platform-posix.h"
|
||||
|
||||
#if OPENTHREAD_ENABLE_POSIX_APP_DAEMON
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#define __APPLE_USE_RFC_3542
|
||||
#endif
|
||||
|
||||
#include "openthread-core-config.h"
|
||||
#include "openthread-posix-config.h"
|
||||
#include "platform-posix.h"
|
||||
|
||||
#include <arpa/inet.h>
|
||||
|
||||
Reference in New Issue
Block a user