-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fix #7212 #7220
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
Fix #7212 #7220
Conversation
lib/system/dyncalls.nim
Outdated
|
|
||
| proc nimLoadLibraryError(path: string) = | ||
| when defined(guiapp): | ||
| discard MessageBoxA(0, msg, "could not load: " & path, 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.
This uses & which uses the GC. Boehm GC is loaded as a DLL --> crash if Boehm cannot be loaded. You need to use some low level stuff to fill an array[Size, char] and pass that to MessageBoxA. Also MessageBoxA is already declared in excpt.nim.
|
@Araq Now it should be good, please review again. |
lib/system/dyncalls.nim
Outdated
| proc nimGetProcAddr(lib: LibHandle, name: cstring): ProcAddr {. | ||
| error: "nimGetProcAddr not implemented".} | ||
|
|
||
| proc nimLoadLibraryError(path: string) = {. |
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.
This is wrong, don't mess with the genode path please.
|
|
||
| proc nimLoadLibraryError(path: string) = | ||
| # carefully written to avoid memory allocation: | ||
| when defined(guiapp): |
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.
when defined(windows) and defined(guiapp)
and then you can merge the two nimLoadLibraryError implementations.
|
Sorry, my code was bad, I will redo it in a new PR. |
I look up, how an error message for an unhanded exception is thrown in excpt.nim, and changed dyncalls.nim to the same behavior.