-/* 7.5 Errors <errno.h>
+/* Errors <errno.h>
This file is part of the Public Domain C Library (PDCLib).
Permission is granted to use, modify, and / or redistribute at will.
#ifndef _PDCLIB_ERRNO_H
#define _PDCLIB_ERRNO_H _PDCLIB_ERRNO_H
+
#include <_PDCLIB_int.h>
-_PDCLIB_BEGIN_EXTERN_C
+
+#ifdef __cplusplus
+extern "C" {
+#endif
extern int * _PDCLIB_errno_func( void );
#define errno (*_PDCLIB_errno_func())
-/* C99 */
-#define ERANGE _PDCLIB_ERANGE
-#define EDOM _PDCLIB_EDOM
-#define EILSEQ _PDCLIB_EILSEQ
+/* C only requires the following three */
+#define ERANGE _PDCLIB_ERANGE
+#define EDOM _PDCLIB_EDOM
+#define EILSEQ _PDCLIB_EILSEQ
-/* C++11. Yes, they did just copy the POSIX errno list into the standard
- *
- * ...take a DEEP breath...
- */
-#define E2BIG _PDCLIB_E2BIG
-#define ECONNRESET _PDCLIB_ECONNRESET
-#define EISCONN _PDCLIB_EISCONN
-#define ENOENT _PDCLIB_ENOENT
+/* C++11 additionally requires the following (taken from POSIX) */
+#define E2BIG _PDCLIB_E2BIG
+#define EACCES _PDCLIB_EACCES
+#define EADDRINUSE _PDCLIB_EADDRINUSE
+#define EADDRNOTAVAIL _PDCLIB_EADDRNOTAVAIL
+#define EAFNOSUPPORT _PDCLIB_EAFNOSUPPORT
+#define EAGAIN _PDCLIB_EAGAIN
+#define EALREADY _PDCLIB_EALREADY
+#define EBADF _PDCLIB_EBADF
+#define EBADMSG _PDCLIB_EBADMSG
+#define EBUSY _PDCLIB_EBUSY
+#define ECANCELED _PDCLIB_ECANCELED
+#define ECHILD _PDCLIB_ECHILD
+#define ECONNABORTED _PDCLIB_ECONNABORTED
+#define ECONNREFUSED _PDCLIB_ECONNREFUSED
+#define ECONNRESET _PDCLIB_ECONNRESET
+#define EDEADLK _PDCLIB_EDEADLK
+#define EDESTADDRREQ _PDCLIB_EDESTADDRREQ
+#define EEXIST _PDCLIB_EEXIST
+#define EFAULT _PDCLIB_EFAULT
+#define EFBIG _PDCLIB_EFBIG
+#define EHOSTUNREACH _PDCLIB_EHOSTUNREACH
+#define EIDRM _PDCLIB_EIDRM
+#define EINPROGRESS _PDCLIB_EINPROGRESS
+#define EINTR _PDCLIB_EINTR
+#define EINVAL _PDCLIB_EINVAL
+#define EIO _PDCLIB_EIO
+#define EISCONN _PDCLIB_EISCONN
+#define EISDIR _PDCLIB_EISDIR
+#define ELOOP _PDCLIB_ELOOP
+#define EMFILE _PDCLIB_EMFILE
+#define EMLINK _PDCLIB_EMLINK
+#define EMSGSIZE _PDCLIB_EMSGSIZE
+#define ENAMETOOLONG _PDCLIB_ENAMETOOLONG
+#define ENETDOWN _PDCLIB_ENETDOWN
+#define ENETRESET _PDCLIB_ENETRESET
+#define ENETUNREACH _PDCLIB_ENETUNREACH
+#define ENFILE _PDCLIB_ENFILE
+#define ENOBUFS _PDCLIB_ENOBUFS
+#define ENODATA _PDCLIB_ENODATA
+#define ENODEV _PDCLIB_ENODEV
+#define ENOENT _PDCLIB_ENOENT
+#define ENOEXEC _PDCLIB_ENOEXEC
+#define ENOLCK _PDCLIB_ENOLCK
+#define ENOLINK _PDCLIB_ENOLINK
+#define ENOMEM _PDCLIB_ENOMEM
+#define ENOMSG _PDCLIB_ENOMSG
+#define ENOPROTOOPT _PDCLIB_ENOPROTOOPT
+#define ENOSPC _PDCLIB_ENOSPC
+#define ENOSR _PDCLIB_ENOSR
+#define ENOSTR _PDCLIB_ENOSTR
+#define ENOSYS _PDCLIB_ENOSYS
+#define ENOTCONN _PDCLIB_ENOTCONN
+#define ENOTDIR _PDCLIB_ENOTDIR
+#define ENOTEMPTY _PDCLIB_ENOTEMPTY
#define ENOTRECOVERABLE _PDCLIB_ENOTRECOVERABLE
-#define EROFS _PDCLIB_EROFS
-#define EACCES _PDCLIB_EACCES
-#define EDEADLK _PDCLIB_EDEADLK
-#define EISDIR _PDCLIB_EISDIR
-#define ENOEXEC _PDCLIB_ENOEXEC
-#define ENOTSOCK _PDCLIB_ENOTSOCK
-#define ESPIPE _PDCLIB_ESPIPE
-#define EADDRINUSE _PDCLIB_EADDRINUSE
-#define EDESTADDRREQ _PDCLIB_EDESTADDRREQ
-#define ELOOP _PDCLIB_ELOOP
-#define ENOLCK _PDCLIB_ENOLCK
-#define ENOTSUP _PDCLIB_ENOTSUPP
-#define ESRCH _PDCLIB_ESRCH
-#define EADDRNOTAVAIL _PDCLIB_EADDRNOTAVAIL
-#define EMFILE _PDCLIB_EMFILE
-#define ENOLINK _PDCLIB_ENOLINK
-#define ENOTTY _PDCLIB_ENOTTY
-#define ETIME _PDCLIB_ETIME
-#define EAFNOSUPPORT _PDCLIB_EAFNOSUPPORT
-#define EEXIST _PDCLIB_EEXIST
-#define EMLINK _PDCLIB_EMLINK
-#define ENOMEM _PDCLIB_ENOMEM
-#define ENXIO _PDCLIB_ENXIO
-#define ETIMEDOUT _PDCLIB_ETIMEDOUT
-#define EAGAIN _PDCLIB_EAGAIN
-#define EFAULT _PDCLIB_EFAULT
-#define EMSGSIZE _PDCLIB_EMSGSIZE
-#define ENOMSG _PDCLIB_ENOMSG
-#define EOPNOTSUPP _PDCLIB_EOPNOTSUPP
-#define ETXTBSY _PDCLIB_ETXTBSY
-#define EALREADY _PDCLIB_EALREADY
-#define EFBIG _PDCLIB_EFBIG
-#define ENAMETOOLONG _PDCLIB_ENAMETOOLONG
-#define ENOPROTOOPT _PDCLIB_ENOPROTOOPT
-#define EOVERFLOW _PDCLIB_EOVERFLOW
-#define EWOULDBLOCK _PDCLIB_EWOULDBLOCK
-#define EBADF _PDCLIB_EBADF
-#define EHOSTUNREACH _PDCLIB_EHOSTUNREACH
-#define ENETDOWN _PDCLIB_ENETDOWN
-#define ENOSPC _PDCLIB_ENOSPC
-#define EOWNERDEAD _PDCLIB_EOWNERDEAD
-#define EXDEV _PDCLIB_EXDEV
-#define EBADMSG _PDCLIB_EBADMSG
-#define EIDRM _PDCLIB_EIDRM
-#define ENETRESET _PDCLIB_ENETRESET
-#define ENOSR _PDCLIB_ENOSR
-#define EPERM _PDCLIB_EPERM
-#define EBUSY _PDCLIB_EBUSY
-#define ENETUNREACH _PDCLIB_ENETUNREACH
-#define ENOSTR _PDCLIB_ENOSTR
-#define EPIPE _PDCLIB_EPIPE
-#define ECANCELED _PDCLIB_ECANCELED
-#define EINPROGRESS _PDCLIB_EINPROGRESS
-#define ENFILE _PDCLIB_ENFILE
-#define ENOSYS _PDCLIB_ENOSYS
-#define EPROTO _PDCLIB_EPROTO
-#define ECHILD _PDCLIB_ECHILD
-#define EINTR _PDCLIB_EINTR
-#define ENOBUFS _PDCLIB_ENOBUFS
-#define ENOTCONN _PDCLIB_ENOTCONN
+#define ENOTSOCK _PDCLIB_ENOTSOCK
+#define ENOTSUP _PDCLIB_ENOTSUP
+#define ENOTTY _PDCLIB_ENOTTY
+#define ENXIO _PDCLIB_ENXIO
+#define EOPNOTSUPP _PDCLIB_EOPNOTSUPP
+#define EOVERFLOW _PDCLIB_EOVERFLOW
+#define EOWNERDEAD _PDCLIB_EOWNERDEAD
+#define EPERM _PDCLIB_EPERM
+#define EPIPE _PDCLIB_EPIPE
+#define EPROTO _PDCLIB_EPROTO
#define EPROTONOSUPPORT _PDCLIB_EPROTONOSUPPORT
-#define ECONNABORTED _PDCLIB_ECONNABORTED
-#define EINVAL _PDCLIB_EINVAL
-#define ENODATA _PDCLIB_ENODATA
-#define ENOTDIR _PDCLIB_ENOTDIR
-#define EPROTOTYPE _PDCLIB_EPROTOTYPE
+#define EPROTOTYPE _PDCLIB_EPROTOTYPE
+#define EROFS _PDCLIB_EROFS
+#define ESPIPE _PDCLIB_ESPIPE
+#define ESRCH _PDCLIB_ESRCH
+#define ETIME _PDCLIB_ETIME
+#define ETIMEDOUT _PDCLIB_ETIMEDOUT
+#define ETXTBSY _PDCLIB_ETXTBSY
+#define EWOULDBLOCK _PDCLIB_EWOULDBLOCK
+#define EXDEV _PDCLIB_EXDEV
-#ifdef _PDCLIB_EIO
-#define EIO _PDCLIB_EIO
+#ifdef __cplusplus
+}
#endif
-_PDCLIB_END_EXTERN_C
#endif
-