Skip to content
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

Update nob_file_exists to distinguish between errors on windows. #72

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

wysiengnik11
Copy link

Update nob_file_exists to distinguish between "does not exists" and other windows errors (todo).

Couldn't get nob to compile and thought #if _WIN32 was the cause, forked already, and then noticed that it doesn't matter, it was something on my end. So I decided to just go ahead and fix something, and #ifdef _WIN32 is now just a consistancy/cleanliness bonus.
Had some trouble with FormatMessage, so helped myself to the answer from stackoverflow.com/questions/455434

Update nob_file_exists to distinguish between "does not exists" and other windows errors (todo).

Couldn't get nob to compile and thought #if _WIN32 was the cause, forked already, and then noticed that it doesn't matter, it was something on my end.
So I decided to just go ahead and fix something, and #ifdef _WIN32 is now just a consistancy/cleanliness bonus.
Had some trouble with FormatMessage, so helped myself to the answer from stackoverflow.com/questions/455434
src/nob.h Outdated Show resolved Hide resolved
Just made a little function and started blasting.
That wasn't supposed to be in there...
@wysiengnik11
Copy link
Author

wysiengnik11 commented Feb 6, 2024

So, anyway, after I took a second look at everything I noticed more of those GetLastError's, made a little function and just started blasting. Tested all of them too, except those more annoying nob_proc_wait ones.

When implementing previous changes to windows error reporting, exit status of user ran commands would get ran through nob_get_last_windows_error_name and return erroneous windows error messages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants