Like mapping errnos. You initialize a struct with entries like:
QP(EPERM),
QP(ENOENT),
QP(ESRCH),
QP(EINTR),
which expands to
{ EPERM, "EPERM" },
{ ENOENT, "ENOENT" },
{ ESRCH, "ESRCH" },
{ EINTR, "EINTR" },
which expands to
{ 1, "EPERM" },
{ 2, "ENOENT" },
{ 3, "ESRCH" },
{ 4, "EINTR" },
And now you can look up the offical #define name of the errno you just got.