| 455 | } |
| 456 | |
| 457 | std::optional<int> ErrnoFromStatusDetail(const StatusDetail& detail) { |
| 458 | if (detail.type_id() == kErrnoDetailTypeId) { |
| 459 | return checked_cast<const ErrnoDetail&>(detail).errnum(); |
| 460 | } |
| 461 | return std::nullopt; |
| 462 | } |
| 463 | |
| 464 | #if _WIN32 |
| 465 | std::shared_ptr<StatusDetail> StatusDetailFromWinError(int errnum) { |