-
Notifications
You must be signed in to change notification settings - Fork 48
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
simplify code relaying all symbols #29
Conversation
The commit use classic c preprocessor approch to handle variadic parameter, which define RMW interface implementation and handle ARG values inside RMW_INTERFACE_FN macro. It obviously reduce code lines and complexity of rmw interface implementation.
Looks windows build still fail, I'll check, BTW, are you using VS 2017 community ? |
We are still using Visual Studio 2015. |
find the reason, EXPAND should also apply to ARGS_ and ARG_VALUES, patch done |
@jwang11 Thank you. The new patch looks good. The ongoing Windows build looks good. I will merge this once it is green and the PR got approved. |
For now I have just suppressed the warning: 3d89670#diff-0e10897bf5aa86e527bbfbb0e10759e9R202 |
Waiting for review. |
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 actually find this a bit more difficult to understand. I guess it makes it easier to change the calling mechanism, but I don't expect that to happen very often. Definitely requires more study before you can see what's going on though.
However, I didn't see anything technically wrong with it while reviewing, so lgtm.
rmw_implementation/src/functions.cpp
Outdated
} | ||
|
||
void * symbol_rmw_init = nullptr; | ||
|
||
rmw_ret_t | ||
rmw_init(void) | ||
rmw_ret_t rmw_init() |
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.
nitpick: why this change?
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.
In the first round all functions were refactored into macros and in a second step rmw_init
was extracted again. I committed 7d4b932 to avoid the diff.
In my opinion the major advantage is the reduction by 260 lines of code as well as not duplicating the function signature of every rmw function anymore. |
This slightly updates #28 to:
update the macro names (underscore between name and number)
remove semicolons after macro calls
declare
rmw_init
explicitly to avoid theinit_fn
argument as well as theFOO_INIT
macroLinux
Linux-aarch64
macOS
Windows