From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?kleines=20Filmr=C3=B6llchen?= Date: Sat, 16 Sep 2023 11:09:57 +0200 Subject: [PATCH] Only check error codes on platforms where they exist --- absl/status/status.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/absl/status/status.cc b/absl/status/status.cc index 26e68294acf7dca9f112987972dc48016c381f4f..68277d5967b23b52f790f7f1f3f6a27f640924eb 100644 --- a/absl/status/status.cc +++ b/absl/status/status.cc @@ -464,14 +464,18 @@ StatusCode ErrnoToStatusCode(int error_number) { case EFAULT: // Bad address case EILSEQ: // Illegal byte sequence case ENOPROTOOPT: // Protocol not available +#ifdef ENOSTR case ENOSTR: // Not a STREAM +#endif case ENOTSOCK: // Not a socket case ENOTTY: // Inappropriate I/O control operation case EPROTOTYPE: // Protocol wrong type for socket case ESPIPE: // Invalid seek return StatusCode::kInvalidArgument; case ETIMEDOUT: // Connection timed out +#ifdef ETIME case ETIME: // Timer expired +#endif return StatusCode::kDeadlineExceeded; case ENODEV: // No such device case ENOENT: // No such file or directory @@ -530,9 +534,13 @@ StatusCode ErrnoToStatusCode(int error_number) { case EMLINK: // Too many links case ENFILE: // Too many open files in system case ENOBUFS: // No buffer space available +#ifdef ENODATA case ENODATA: // No message is available on the STREAM read queue +#endif case ENOMEM: // Not enough space +#ifdef ENOSR case ENOSR: // No STREAM resources +#endif #ifdef EUSERS case EUSERS: // Too many users #endif @@ -575,7 +583,9 @@ StatusCode ErrnoToStatusCode(int error_number) { case ENETRESET: // Connection aborted by network case ENETUNREACH: // Network unreachable case ENOLCK: // No locks available +#ifdef ENOLINK case ENOLINK: // Link has been severed +#endif #ifdef ENONET case ENONET: // Machine is not on the network #endif