chromium/third_party/libc++/src/include/errno.h

// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_ERRNO_H
#define _LIBCPP_ERRNO_H

/*
    errno.h synopsis

Macros:

    EDOM
    EILSEQ  // C99
    ERANGE
    errno

*/

#include <__config>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#  pragma GCC system_header
#endif

#if __has_include_next(<errno.h>)
#  include_next <errno.h>
#endif

#ifdef __cplusplus

#  if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)

#    ifdef ELAST

static const int __elast1 = ELAST + 1;
static const int __elast2 = ELAST + 2;

#    else

static const int __elast1 = 104;
static const int __elast2 = 105;

#    endif

#    ifdef ENOTRECOVERABLE

#define EOWNERDEAD

#      ifdef ELAST
#        undef ELAST
#define ELAST
#      endif

#    elif defined(EOWNERDEAD)

#define ENOTRECOVERABLE
#      ifdef ELAST
#        undef ELAST
#define ELAST
#      endif

#    else // defined(EOWNERDEAD)

#define EOWNERDEAD
#define ENOTRECOVERABLE
#      ifdef ELAST
#        undef ELAST
#define ELAST
#      endif

#    endif // defined(EOWNERDEAD)

#  endif // !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)

//  supply errno values likely to be missing, particularly on Windows

#  ifndef EAFNOSUPPORT
#define EAFNOSUPPORT
#  endif

#  ifndef EADDRINUSE
#define EADDRINUSE
#  endif

#  ifndef EADDRNOTAVAIL
#define EADDRNOTAVAIL
#  endif

#  ifndef EISCONN
#define EISCONN
#  endif

#  ifndef EBADMSG
#define EBADMSG
#  endif

#  ifndef ECONNABORTED
#define ECONNABORTED
#  endif

#  ifndef EALREADY
#define EALREADY
#  endif

#  ifndef ECONNREFUSED
#define ECONNREFUSED
#  endif

#  ifndef ECONNRESET
#define ECONNRESET
#  endif

#  ifndef EDESTADDRREQ
#define EDESTADDRREQ
#  endif

#  ifndef EHOSTUNREACH
#define EHOSTUNREACH
#  endif

#  ifndef EIDRM
#define EIDRM
#  endif

#  ifndef EMSGSIZE
#define EMSGSIZE
#  endif

#  ifndef ENETDOWN
#define ENETDOWN
#  endif

#  ifndef ENETRESET
#define ENETRESET
#  endif

#  ifndef ENETUNREACH
#define ENETUNREACH
#  endif

#  ifndef ENOBUFS
#define ENOBUFS
#  endif

#  ifndef ENOLINK
#define ENOLINK
#  endif

#  ifndef ENODATA
#define ENODATA
#  endif

#  ifndef ENOMSG
#define ENOMSG
#  endif

#  ifndef ENOPROTOOPT
#define ENOPROTOOPT
#  endif

#  ifndef ENOSR
#define ENOSR
#  endif

#  ifndef ENOTSOCK
#define ENOTSOCK
#  endif

#  ifndef ENOSTR
#define ENOSTR
#  endif

#  ifndef ENOTCONN
#define ENOTCONN
#  endif

#  ifndef ENOTSUP
#define ENOTSUP
#  endif

#  ifndef ECANCELED
#define ECANCELED
#  endif

#  ifndef EINPROGRESS
#define EINPROGRESS
#  endif

#  ifndef EOPNOTSUPP
#define EOPNOTSUPP
#  endif

#  ifndef EWOULDBLOCK
#define EWOULDBLOCK
#  endif

#  ifndef EOWNERDEAD
#define EOWNERDEAD
#  endif

#  ifndef EPROTO
#define EPROTO
#  endif

#  ifndef EPROTONOSUPPORT
#define EPROTONOSUPPORT
#  endif

#  ifndef ENOTRECOVERABLE
#define ENOTRECOVERABLE
#  endif

#  ifndef ETIME
#define ETIME
#  endif

#  ifndef ETXTBSY
#define ETXTBSY
#  endif

#  ifndef ETIMEDOUT
#define ETIMEDOUT
#  endif

#  ifndef ELOOP
#define ELOOP
#  endif

#  ifndef EOVERFLOW
#define EOVERFLOW
#  endif

#  ifndef EPROTOTYPE
#define EPROTOTYPE
#  endif

#  ifndef ENOSYS
#define ENOSYS
#  endif

#  ifndef EINVAL
#define EINVAL
#  endif

#  ifndef ERANGE
#define ERANGE
#  endif

#  ifndef EILSEQ
#define EILSEQ
#  endif

//  Windows Mobile doesn't appear to define these:

#  ifndef E2BIG
#define E2BIG
#  endif

#  ifndef EDOM
#define EDOM
#  endif

#  ifndef EFAULT
#define EFAULT
#  endif

#  ifndef EBADF
#define EBADF
#  endif

#  ifndef EPIPE
#define EPIPE
#  endif

#  ifndef EXDEV
#define EXDEV
#  endif

#  ifndef EBUSY
#define EBUSY
#  endif

#  ifndef ENOTEMPTY
#define ENOTEMPTY
#  endif

#  ifndef ENOEXEC
#define ENOEXEC
#  endif

#  ifndef EEXIST
#define EEXIST
#  endif

#  ifndef EFBIG
#define EFBIG
#  endif

#  ifndef ENAMETOOLONG
#define ENAMETOOLONG
#  endif

#  ifndef ENOTTY
#define ENOTTY
#  endif

#  ifndef EINTR
#define EINTR
#  endif

#  ifndef ESPIPE
#define ESPIPE
#  endif

#  ifndef EIO
#define EIO
#  endif

#  ifndef EISDIR
#define EISDIR
#  endif

#  ifndef ECHILD
#define ECHILD
#  endif

#  ifndef ENOLCK
#define ENOLCK
#  endif

#  ifndef ENOSPC
#define ENOSPC
#  endif

#  ifndef ENXIO
#define ENXIO
#  endif

#  ifndef ENODEV
#define ENODEV
#  endif

#  ifndef ENOENT
#define ENOENT
#  endif

#  ifndef ESRCH
#define ESRCH
#  endif

#  ifndef ENOTDIR
#define ENOTDIR
#  endif

#  ifndef ENOMEM
#define ENOMEM
#  endif

#  ifndef EPERM
#define EPERM
#  endif

#  ifndef EACCES
#define EACCES
#  endif

#  ifndef EROFS
#define EROFS
#  endif

#  ifndef EDEADLK
#define EDEADLK
#  endif

#  ifndef EAGAIN
#define EAGAIN
#  endif

#  ifndef ENFILE
#define ENFILE
#  endif

#  ifndef EMFILE
#define EMFILE
#  endif

#  ifndef EMLINK
#define EMLINK
#  endif

#endif // __cplusplus

#endif // _LIBCPP_ERRNO_H