-
Notifications
You must be signed in to change notification settings - Fork 82
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
[Windows] Add multi os wrapper for loading dynamic libraries #2879
Conversation
7f3dde0
to
8a8b97a
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.
- Please Fill Commit body message on below commits for log & clear understanding of others
- Ignore doxygen tag CI Failed, for external file we don't need to make doxygen tags
@DonghakPark We are exporting every header files to .dev package. But, this is not a good practice and we need to choose header files that are needed by external packages and exclude other headers from .dev package. Opening up all the symbols to external packages is not a good design choice (you are declaring all functions as APIs by doing so.) |
That's correct. |
It's Saturday morning. Go somewhere else! Anyway, I recommend to put externally available headers into a designated directory for easier maintanance. |
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.
Nice work!
#define RTLD_DEEPBIND 0 | ||
#define RTLD_GLOBAL 0 | ||
#define RTLD_LOCAL 0 | ||
#define RTLD_NODELETE 0 |
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.
Some of the flags, such as RTLD_BINDING_MASK
, are currently unused. Will we use these unused flags in the future?
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've added all flags defined in bits/dlfcn.h linux header to ensure full compatibility.
I do not think that we will use all of them.
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.
Or.. we may hide them by:
class DynamicLibraryLoader {
public:
static void *loadLibrary(const char *path, [[maybe_unused]] int lazy = 0) {
#if defined(_WIN32)
return LoadLibraryA(path);
#else
return dlopen(path, (lazy ? RTLD_LAZY : RTLD_NOW) | RTLD_LOCAL);
#endif
}
8a8b97a
to
595559c
Compare
Create class which make possible to use the same interface for loading dynamic libraries and symbols for mutliple operating systems **Self-evaluation:** 1. Build test: [X]Passed [ ]Failed [ ]Skipped 2. Run test: [X]Passed [ ]Failed [ ]Skipped Signed-off-by: Grzegorz Kisala <[email protected]>
595559c
to
49037e7
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!
Create class which make possible to use the same interface for loading dynamic libraries and symbols for multiple operating systems
Self-evaluation: