dll import/export visibility macro update #26
Merged
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.
further updates to support DLL import/export on Windows =)
ROSCONSOLE_BACKEND_DECL
(from previous visibility change) forconsole_backend.h
console_impl
functions shared bylog4cxx
,glog
,print
into one single headerconsole_impl.h
(and remove the function declarations fromrosconsole.cpp
)as mentioned in the comments, the
ROSCONSOLE_CONSOLE_IMPL_DECL
macro is added to manage visibility for functions in the impl components in one centralized position. For the implementations (src/rosconsole/impl/rosconsole_xxx.cpp
),ROSCONSOLE_CONSOLE_IMPL_EXPORTS
needs to be defined in the .cpp file before includingconsole_impl.h
since these files are compiled to generate their own runtime binaries (dlls). Another way of achieving the same result would be to use independent visibility control macros for each implementation; however, that means more duplicated code and makes it harder to manage.Another reason to use a centralized header is so that it'd be easier to notice when the declaration and definition have a mismatch (at compile time); otherwise, such mismatch would cause error at runtime, making it harder to spot.