[posix] enhance config header file (#11426)

This commit enhances the `openthread-posix-config.h` header by:

- Moving configurations defined in other headers
  (`platform-posix.h`) into this common header.
- Making sure the section containing guard checks for removed or
  renamed POSIX configurations is at the end of the header file.
This commit is contained in:
Abtin Keshavarzian
2025-04-21 13:28:56 -07:00
committed by GitHub
parent 8d40aa3462
commit 7536e3c73b
2 changed files with 20 additions and 20 deletions
+20 -11
View File
@@ -256,6 +256,15 @@
#define OPENTHREAD_POSIX_CONFIG_THREAD_NETIF_DEFAULT_NAME "wpan0"
#endif
/**
* @def OPENTHREAD_POSIX_VIRTUAL_TIME
*
* This setting configures whether to use virtual time.
*/
#ifndef OPENTHREAD_POSIX_VIRTUAL_TIME
#define OPENTHREAD_POSIX_VIRTUAL_TIME 0
#endif
#ifdef __APPLE__
/**
@@ -279,17 +288,6 @@
#endif // __APPLE__
//---------------------------------------------------------------------------------------------------------------------
// Removed or renamed POSIX specific configs.
#ifdef OPENTHREAD_CONFIG_POSIX_APP_TREL_INTERFACE_NAME
#error "OPENTHREAD_CONFIG_POSIX_APP_TREL_INTERFACE_NAME was removed (no longer applicable with TREL over DNS-SD)."
#endif
#ifdef OPENTHREAD_CONFIG_POSIX_TREL_USE_NETLINK_SOCKET
#error "OPENTHREAD_CONFIG_POSIX_TREL_USE_NETLINK_SOCKET was removed (no longer applicable with TREL over DNS-SD)."
#endif
/**
* @def OPENTHREAD_POSIX_CONFIG_TREL_UDP_PORT
*
@@ -444,4 +442,15 @@
#define OPENTHREAD_POSIX_CONFIG_RESOLV_CONF_ENABLED_INIT (!OPENTHREAD_POSIX_CONFIG_ANDROID_ENABLE)
#endif
//---------------------------------------------------------------------------------------------------------------------
// Removed or renamed POSIX specific configs.
#ifdef OPENTHREAD_CONFIG_POSIX_APP_TREL_INTERFACE_NAME
#error "OPENTHREAD_CONFIG_POSIX_APP_TREL_INTERFACE_NAME was removed (no longer applicable with TREL over DNS-SD)."
#endif
#ifdef OPENTHREAD_CONFIG_POSIX_TREL_USE_NETLINK_SOCKET
#error "OPENTHREAD_CONFIG_POSIX_TREL_USE_NETLINK_SOCKET was removed (no longer applicable with TREL over DNS-SD)."
#endif
#endif // OPENTHREAD_PLATFORM_POSIX_CONFIG_H_
-9
View File
@@ -56,15 +56,6 @@
#include "lib/spinel/coprocessor_type.h"
#include "lib/url/url.hpp"
/**
* @def OPENTHREAD_POSIX_VIRTUAL_TIME
*
* This setting configures whether to use virtual time.
*/
#ifndef OPENTHREAD_POSIX_VIRTUAL_TIME
#define OPENTHREAD_POSIX_VIRTUAL_TIME 0
#endif
/**
* This is the socket name used by daemon mode.
*/