You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Surprisingly nontrivial. So C fopen uses a global variable errno for that information, which is implemented as a thread local or funciton call when C threads are enabled by compiler flag on modern system, but not on all systems.
So I would suggest to change the Nim open wrapper (but not the fopen wrapper) to
(1) If Nim is compiled with threads=off, assume it's a global, look up the meaning, and add it to the exception, and also add the error code itself to the exception and create a list of constants to represent them
(2) if Nim is compiled with threads=on, implement whatever is in the errnoC macro i Nim, possibly platform specific. This is going to require a lot of test cases.
Once we moved io.nim out of system.nim (compatible with our version 2 goals) it should be easier to provide a more elaborate implementation, ideally one that avoids libc and calls into Windows/Posix directly.
Seeing the following:
Is vague. It would be better to include more detailed info like:
The text was updated successfully, but these errors were encountered: