-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
include: Prefix includes to use a scope #44320
include: Prefix includes to use a scope #44320
Conversation
My thinking was to de-risk. While others may not |
so there are two cases:
The 1st case is not possible since In that sense, I agree that the |
being able to include <zephyr/kernel/mmu.h> and being on the level and under the same namespace makes it look like this header is public and can be used by anyone. |
0967cde
to
7a4e2b7
Compare
7a4e2b7
to
65b0c55
Compare
@@ -4,7 +4,7 @@ | |||
zephyr_interface_library_named(posix_subsys) | |||
|
|||
if(CONFIG_POSIX_API) | |||
target_include_directories(posix_subsys INTERFACE ${ZEPHYR_BASE}/include/posix) | |||
target_include_directories(posix_subsys INTERFACE ${ZEPHYR_BASE}/include/zephyr/posix) |
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.
This can probably stay as include/posix
since the POSIX headers were placed under include/posix/
instead of include/
for the very same reason (i.e. namespace conflict issues), and the header files under include/posix/
are not really "Zephyr headers;" but no strong opinion here.
FYI @cfriedt
65b0c55
to
5ef2c79
Compare
Looks like I missed a file at |
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.
+1 refresh
Move include paths and add new target_include_directories to support backwards compatibility: * /include -> /include/zephyr example: <irq.h> -> <zephyr/irq.h> Issue zephyrproject-rtos#41543 Signed-off-by: Yuval Peress <peress@google.com>
Add a Kconfig to disable non prefixed includes. By setting `CONFIG_LEGACY_INCLUDE_PATH=n` developers can disable having `include/zephyr` in the search path. This means that includes such as `#include <kernel.h>` will no longer work. Internally, every header should be updated to add the `zephyr/` prefix to the headers. Only then, will developers be able to use this config value for their applications. Signed-off-by: Yuval Peress <peress@google.com>
Fix a documentation build warning by adding the type to the configs Signed-off-by: Yuval Peress <peress@google.com>
7c69ee7
5ef2c79
to
7c69ee7
Compare
Move include paths and add new target_include_directories to support
backwards compatibility:
example: <irq.h> -> <zephyr/irq.h>
example: <thread.h> -> <zephyr/kernel/threads.h>
Issue #41543
Signed-off-by: Yuval Peress peress@google.com