Commit be857cc4 authored by Kenton Varda's avatar Kenton Varda

Fix build on OSX, etc. by checking whether each errno is defined.

parent 05620fa8
...@@ -51,34 +51,74 @@ namespace { ...@@ -51,34 +51,74 @@ namespace {
Exception::Type typeOfErrno(int error) { Exception::Type typeOfErrno(int error) {
switch (error) { switch (error) {
#ifdef EDQUOT
case EDQUOT: case EDQUOT:
#endif
#ifdef EMFILE
case EMFILE: case EMFILE:
#endif
#ifdef ENFILE
case ENFILE: case ENFILE:
#endif
#ifdef ENOBUFS
case ENOBUFS: case ENOBUFS:
#endif
#ifdef ENOLCK
case ENOLCK: case ENOLCK:
#endif
#ifdef ENOMEM
case ENOMEM: case ENOMEM:
#endif
#ifdef ENOSPC
case ENOSPC: case ENOSPC:
#endif
#ifdef ETIMEDOUT
case ETIMEDOUT: case ETIMEDOUT:
#endif
#ifdef EUSERS
case EUSERS: case EUSERS:
#endif
return Exception::Type::OVERLOADED; return Exception::Type::OVERLOADED;
#ifdef ECONNABORTED
case ECONNABORTED: case ECONNABORTED:
#endif
#ifdef ECONNREFUSED
case ECONNREFUSED: case ECONNREFUSED:
#endif
#ifdef ECONNRESET
case ECONNRESET: case ECONNRESET:
#endif
#ifdef EHOSTDOWN
case EHOSTDOWN: case EHOSTDOWN:
#endif
#ifdef EHOSTUNREACH
case EHOSTUNREACH: case EHOSTUNREACH:
#endif
#ifdef ENETDOWN
case ENETDOWN: case ENETDOWN:
#endif
#ifdef ENETRESET
case ENETRESET: case ENETRESET:
#endif
#ifdef ENETUNREACH
case ENETUNREACH: case ENETUNREACH:
#endif
#ifdef ENONET
case ENONET: case ENONET:
#endif
#ifdef EPIPE
case EPIPE: case EPIPE:
#endif
return Exception::Type::DISCONNECTED; return Exception::Type::DISCONNECTED;
#ifdef ENOSYS
case ENOSYS: case ENOSYS:
#if ENOTSUP #endif
#ifdef ENOTSUP
case ENOTSUP: case ENOTSUP:
#endif #endif
#if EOPNOTSUPP && EOPNOTSUPP != ENOTSUP #if defined(EOPNOTSUPP) && EOPNOTSUPP != ENOTSUP
case EOPNOTSUPP: case EOPNOTSUPP:
#endif #endif
return Exception::Type::UNIMPLEMENTED; return Exception::Type::UNIMPLEMENTED;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment