-
Notifications
You must be signed in to change notification settings - Fork 62
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
Better handling of errors during dynamic catalogue loading #1702
Conversation
arbor/util/dl.hpp
Outdated
#endif | ||
|
||
#ifndef DL | ||
#error "No platform with dynamic loading found" |
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.
Not sure that's true: Windows also has the concept of dynamic loading, right? I can ctypes.CDLL("my.dll")
or LoadLibrary("my.dll");
on Windows.
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.
Yes it does. However, it does not use the POSIX/Unix way using dlopen
, but rather the Win32 LoadLibrary
. So, the compiler error is the prompt for us implement the API outlined in dl_platform_posix.hpp
when the time should come to port to Windows. Same story for BSD: Once we compile there, we need to test dl_platform_posix.hpp
against that OS, add an ifdef
, and move on. But as long as we do not regularly test on those platforms, I would rather not enable them.
The error message should probably say "No platform support for dynamic loading found" though
Might need to namespace the expected error: |
Issue is the semantics of Update: Fix is to use |
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!
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.
Looks great thanks! I have a few questions about that code and the possible problems we can run in to.
const char*
error messagesutil/dl.hpp
and select correct platform by CPP.dl.hpp
and wrap them inbad_catalogue_error