summaryrefslogtreecommitdiff
path: root/Modules/errnomodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/errnomodule.c')
-rw-r--r--Modules/errnomodule.c82
1 files changed, 82 insertions, 0 deletions
diff --git a/Modules/errnomodule.c b/Modules/errnomodule.c
index 86720af49d..06ed53a64d 100644
--- a/Modules/errnomodule.c
+++ b/Modules/errnomodule.c
@@ -7,6 +7,33 @@
#ifdef MS_WINDOWS
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
+/* The following constants were added to errno.h in VS2010 but have
+ preferred WSA equivalents. */
+#undef EADDRINUSE
+#undef EADDRNOTAVAIL
+#undef EAFNOSUPPORT
+#undef EALREADY
+#undef ECONNABORTED
+#undef ECONNREFUSED
+#undef ECONNRESET
+#undef EDESTADDRREQ
+#undef EHOSTUNREACH
+#undef EINPROGRESS
+#undef EISCONN
+#undef ELOOP
+#undef EMSGSIZE
+#undef ENETDOWN
+#undef ENETRESET
+#undef ENETUNREACH
+#undef ENOBUFS
+#undef ENOPROTOOPT
+#undef ENOTCONN
+#undef ENOTSOCK
+#undef EOPNOTSUPP
+#undef EPROTONOSUPPORT
+#undef EPROTOTYPE
+#undef ETIMEDOUT
+#undef EWOULDBLOCK
#endif
/*
@@ -84,6 +111,8 @@ PyInit_errno(void)
* The names and comments are borrowed from linux/include/errno.h,
* which should be pretty all-inclusive. However, the Solaris specific
* names and comments are borrowed from sys/errno.h in Solaris.
+ * MacOSX specific names and comments are borrowed from sys/errno.h in
+ * MacOSX.
*/
#ifdef ENODEV
@@ -848,6 +877,59 @@ PyInit_errno(void)
inscode(d, ds, de, "ENOTACTIVE", ENOTACTIVE, "Facility is not active");
#endif
+ /* MacOSX specific errnos */
+#ifdef EAUTH
+ inscode(d, ds, de, "EAUTH", EAUTH, "Authentication error");
+#endif
+#ifdef EBADARCH
+ inscode(d, ds, de, "EBADARCH", EBADARCH, "Bad CPU type in executable");
+#endif
+#ifdef EBADEXEC
+ inscode(d, ds, de, "EBADEXEC", EBADEXEC, "Bad executable (or shared library)");
+#endif
+#ifdef EBADMACHO
+ inscode(d, ds, de, "EBADMACHO", EBADMACHO, "Malformed Mach-o file");
+#endif
+#ifdef EBADRPC
+ inscode(d, ds, de, "EBADRPC", EBADRPC, "RPC struct is bad");
+#endif
+#ifdef EDEVERR
+ inscode(d, ds, de, "EDEVERR", EDEVERR, "Device error");
+#endif
+#ifdef EFTYPE
+ inscode(d, ds, de, "EFTYPE", EFTYPE, "Inappropriate file type or format");
+#endif
+#ifdef ENEEDAUTH
+ inscode(d, ds, de, "ENEEDAUTH", ENEEDAUTH, "Need authenticator");
+#endif
+#ifdef ENOATTR
+ inscode(d, ds, de, "ENOATTR", ENOATTR, "Attribute not found");
+#endif
+#ifdef ENOPOLICY
+ inscode(d, ds, de, "ENOPOLICY", ENOPOLICY, "Policy not found");
+#endif
+#ifdef EPROCLIM
+ inscode(d, ds, de, "EPROCLIM", EPROCLIM, "Too many processes");
+#endif
+#ifdef EPROCUNAVAIL
+ inscode(d, ds, de, "EPROCUNAVAIL", EPROCUNAVAIL, "Bad procedure for program");
+#endif
+#ifdef EPROGMISMATCH
+ inscode(d, ds, de, "EPROGMISMATCH", EPROGMISMATCH, "Program version wrong");
+#endif
+#ifdef EPROGUNAVAIL
+ inscode(d, ds, de, "EPROGUNAVAIL", EPROGUNAVAIL, "RPC prog. not avail");
+#endif
+#ifdef EPWROFF
+ inscode(d, ds, de, "EPWROFF", EPWROFF, "Device power is off");
+#endif
+#ifdef ERPCMISMATCH
+ inscode(d, ds, de, "ERPCMISMATCH", ERPCMISMATCH, "RPC version wrong");
+#endif
+#ifdef ESHLIBVERS
+ inscode(d, ds, de, "ESHLIBVERS", ESHLIBVERS, "Shared library version mismatch");
+#endif
+
Py_DECREF(de);
return m;
}