#ifdef ENOTSOCK
case ENOTSOCK: return "ENOTSOCK";
#endif
-#if !defined(linux)
#ifdef ENOTSUP
case ENOTSUP: return "ENOTSUP";
#endif
-#endif
#ifdef ENOTTY
case ENOTTY: return "ENOTTY";
#endif
#ifdef ENXIO
case ENXIO: return "ENXIO";
#endif
-#ifdef EOPNOTSUPP
+#if defined(EOPNOTSUPP) && (!defined(ENOTSUP) || (EOPNOTSUPP != ENOTSUP))
case EOPNOTSUPP: return "EOPNOTSUPP";
#endif
#ifdef EPERM
#ifdef ENOTSOCK
case ENOTSOCK: return "socket operation on non-socket";
#endif
-#if !defined(linux)
#ifdef ENOTSUP
case ENOTSUP: return "operation not supported";
#endif
-#endif
#ifdef ENOTTY
case ENOTTY: return "inappropriate device for ioctl";
#endif
#ifdef ENXIO
case ENXIO: return "no such device or address";
#endif
-#ifdef EOPNOTSUPP
+#if defined(EOPNOTSUPP) && (!defined(ENOTSUP) || (EOPNOTSUPP != ENOTSUP))
case EOPNOTSUPP: return "operation not supported on socket";
#endif
#ifdef EPERM