-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[posix] adjust posix platform header including #10221
Conversation
Size Report of OpenThread
|
Is it possible to add new config file |
I think this is an option. However I think it's very confusing that we have both I have checked the current
So maybe let's the devide the options into two categories: related with core and unrelated with core. And let's naming them as |
Sounds good. |
67d3c1b
to
e67330a
Compare
43a4d0b
to
e8920e0
Compare
e8920e0
to
221ebd6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -35,8 +35,10 @@ | |||
#define OT_POSIX_PLATFORM_INFRA_IF_HPP_ | |||
|
|||
#include "openthread-posix-config.h" | |||
#include "openthread-posix-core-related-config.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Irving-cl, I understand the goal of making spinel_interface
modules independent of the OT code (as a standalone library), but I'm not clear why we need to change infra_if
, netif
, udp
, etc., so they don't include openthread-core-config.h
. These modules are part of the platform layer and should be able to see this header. They shouldn't be part of the spinel library module used by a host-side implementation.
#ifndef OPENTHREAD_POSIX_CONFIG_INFRA_IF_ENABLE | ||
#define OPENTHREAD_POSIX_CONFIG_INFRA_IF_ENABLE \ | ||
(OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE || OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE) | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe replicating the configurations, defining similar ones under new name of OPENTHREAD_POSIX
derived from OPENTHREAD_CONFIG
, can get confusing and may lead to incorrect usage. Do we need this? Is there any other way?
@abtink Thanks! After thinking more on this, I think we should use another alternative. FYI, the original intention of this PR is to make However it looks like including posix platform header directly from So I think we should still update the |
Close this PR. Will use another approach. |
This purpose of this PR is to avoid the include chain starting from
posix/platform/xxx_interface.hpp
from containing anything from OTcore and
lib/platform/exit_code.h
. Becausexxx_interface.hpp
isincluded by
spinel_manager.hpp
which is intended to be used inot-br-posix
.The PR does these things:
config file
openthread-posix-core-related-config.h
and only includethis file when needed. And remove the including of
openthread-core-config.h
from
openthread-posix-config.h
.platform-posix.h
in headers and add necessaryincluding. i.e.,
lib/url/url.hpp
. Becauseplatform-posix.h
includeslib/platform/exit_code.h
which contains some widely used name likeVerifyOrDie
and may cause conflicts.openthread-core-config.h
if necessary. Originally, these configs were included indirectly by
the chain
openthread-posix-config.h -> openthread-core-config.h