-
Notifications
You must be signed in to change notification settings - Fork 0
[feat] 添加了一个优先级最高的自动导出 #15
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
Merged
+6
−4
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,13 +58,15 @@ typedef void (*_ek_export_init_fn_t)(void); | |
| const _ek_export_init_fn_t __init_##fn##prio __attribute__((used, section(".ek_export_fn." _EK_STR(prio)))) = \ | ||
| (fn) | ||
|
|
||
| # define EK_EXPORT_HARDWARE(fn) EK_EXPORT((fn), 0) | ||
| # define EK_EXPORT_COMPONENTS(fn) EK_EXPORT((fn), 1) | ||
| # define EK_EXPORT_APP(fn) EK_EXPORT((fn), 2) | ||
| # define EK_EXPORT_USER(fn) EK_EXPORT((fn), 3) | ||
| # define EK_EXPORT_EARLIEST(fn) EK_EXPORT(fn, 0) | ||
| # define EK_EXPORT_HARDWARE(fn) EK_EXPORT(fn, 1) | ||
| # define EK_EXPORT_COMPONENTS(fn) EK_EXPORT(fn, 2) | ||
| # define EK_EXPORT_APP(fn) EK_EXPORT(fn, 3) | ||
| # define EK_EXPORT_USER(fn) EK_EXPORT(fn, 4) | ||
|
Comment on lines
+61
to
+65
|
||
|
|
||
| #else | ||
|
|
||
| # define EK_EXPORT_EARLIEST(fn) | ||
| # define EK_EXPORT(fn, prio) | ||
| # define EK_EXPORT_HARDWARE(fn) | ||
| # define EK_EXPORT_COMPONENTS(fn) | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
这些
EK_EXPORT_*便捷宏会把fn传入EK_EXPORT,而EK_EXPORT会在符号名里做__init_##fn##prio的 token-paste;因此fn实际上必须是“函数名标识符”,不能是任意函数指针表达式(例如&fn、强转、括号包裹的表达式等),否则会触发预处理/编译错误。建议在这些宏附近补充注释/文档,明确fn的用法约束。