Skip to content

Instantly share code, notes, and snippets.

@AndyNovo
Created December 5, 2016 15:34
Show Gist options
  • Save AndyNovo/0fee4ec9404c9a13ae1eeb684d92f548 to your computer and use it in GitHub Desktop.
Save AndyNovo/0fee4ec9404c9a13ae1eeb684d92f548 to your computer and use it in GitHub Desktop.
static const struct {
DWORD winerr;
int doserr;
} doserrors[] =
{
...
};
static void
la_dosmaperr(unsigned long e)
{
...
for (i = 0; i < sizeof(doserrors); i++)
{
if (doserrors[i].winerr == e)
{
errno = doserrors[i].doserr;
return;
}
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment