Skip to content

Commit 7536e3c

Browse files
authored
[posix] enhance config header file (openthread#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.
1 parent 8d40aa3 commit 7536e3c

2 files changed

Lines changed: 20 additions & 20 deletions

File tree

src/posix/platform/openthread-posix-config.h

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,15 @@
256256
#define OPENTHREAD_POSIX_CONFIG_THREAD_NETIF_DEFAULT_NAME "wpan0"
257257
#endif
258258

259+
/**
260+
* @def OPENTHREAD_POSIX_VIRTUAL_TIME
261+
*
262+
* This setting configures whether to use virtual time.
263+
*/
264+
#ifndef OPENTHREAD_POSIX_VIRTUAL_TIME
265+
#define OPENTHREAD_POSIX_VIRTUAL_TIME 0
266+
#endif
267+
259268
#ifdef __APPLE__
260269

261270
/**
@@ -279,17 +288,6 @@
279288

280289
#endif // __APPLE__
281290

282-
//---------------------------------------------------------------------------------------------------------------------
283-
// Removed or renamed POSIX specific configs.
284-
285-
#ifdef OPENTHREAD_CONFIG_POSIX_APP_TREL_INTERFACE_NAME
286-
#error "OPENTHREAD_CONFIG_POSIX_APP_TREL_INTERFACE_NAME was removed (no longer applicable with TREL over DNS-SD)."
287-
#endif
288-
289-
#ifdef OPENTHREAD_CONFIG_POSIX_TREL_USE_NETLINK_SOCKET
290-
#error "OPENTHREAD_CONFIG_POSIX_TREL_USE_NETLINK_SOCKET was removed (no longer applicable with TREL over DNS-SD)."
291-
#endif
292-
293291
/**
294292
* @def OPENTHREAD_POSIX_CONFIG_TREL_UDP_PORT
295293
*
@@ -444,4 +442,15 @@
444442
#define OPENTHREAD_POSIX_CONFIG_RESOLV_CONF_ENABLED_INIT (!OPENTHREAD_POSIX_CONFIG_ANDROID_ENABLE)
445443
#endif
446444

445+
//---------------------------------------------------------------------------------------------------------------------
446+
// Removed or renamed POSIX specific configs.
447+
448+
#ifdef OPENTHREAD_CONFIG_POSIX_APP_TREL_INTERFACE_NAME
449+
#error "OPENTHREAD_CONFIG_POSIX_APP_TREL_INTERFACE_NAME was removed (no longer applicable with TREL over DNS-SD)."
450+
#endif
451+
452+
#ifdef OPENTHREAD_CONFIG_POSIX_TREL_USE_NETLINK_SOCKET
453+
#error "OPENTHREAD_CONFIG_POSIX_TREL_USE_NETLINK_SOCKET was removed (no longer applicable with TREL over DNS-SD)."
454+
#endif
455+
447456
#endif // OPENTHREAD_PLATFORM_POSIX_CONFIG_H_

src/posix/platform/platform-posix.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,6 @@
5656
#include "lib/spinel/coprocessor_type.h"
5757
#include "lib/url/url.hpp"
5858

59-
/**
60-
* @def OPENTHREAD_POSIX_VIRTUAL_TIME
61-
*
62-
* This setting configures whether to use virtual time.
63-
*/
64-
#ifndef OPENTHREAD_POSIX_VIRTUAL_TIME
65-
#define OPENTHREAD_POSIX_VIRTUAL_TIME 0
66-
#endif
67-
6859
/**
6960
* This is the socket name used by daemon mode.
7061
*/

0 commit comments

Comments
 (0)