1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* include/ruby/win32.h: include errno.h before defining errnos.

* include/ruby/win32.h: check definition existance before defining
  errno macros.

* win32/win32.c (errmap): define winsock errors mappings.
  these are VC++10 support, merge from trunk (r27236, r27258).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@28193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2010-06-07 09:20:12 +00:00
parent 9f9388e57e
commit f10f897bd1
3 changed files with 164 additions and 37 deletions

View file

@ -1,3 +1,13 @@
Mon Jun 7 18:18:03 2010 NAKAMURA Usaku <usa@ruby-lang.org>
* include/ruby/win32.h: include errno.h before defining errnos.
* include/ruby/win32.h: check definition existance before defining
errno macros.
* win32/win32.c (errmap): define winsock errors mappings.
these are VC++10 support, merge from trunk (r27236, r27258).
Mon Jun 7 12:27:29 2010 NARUSE, Yui <naruse@ruby-lang.org> Mon Jun 7 12:27:29 2010 NARUSE, Yui <naruse@ruby-lang.org>
* regexp.c (re_compile_pattern): allow zero times match for * regexp.c (re_compile_pattern): allow zero times match for

View file

@ -178,15 +178,60 @@ static struct {
{ ERROR_INFLOOP_IN_RELOC_CHAIN, ENOEXEC }, { ERROR_INFLOOP_IN_RELOC_CHAIN, ENOEXEC },
{ ERROR_FILENAME_EXCED_RANGE, ENOENT }, { ERROR_FILENAME_EXCED_RANGE, ENOENT },
{ ERROR_NESTING_NOT_ALLOWED, EAGAIN }, { ERROR_NESTING_NOT_ALLOWED, EAGAIN },
#ifndef ERROR_PIPE_LOCAL
#define ERROR_PIPE_LOCAL 229L
#endif
{ ERROR_PIPE_LOCAL, EPIPE },
{ ERROR_BAD_PIPE, EPIPE },
{ ERROR_PIPE_BUSY, EAGAIN },
{ ERROR_NO_DATA, EPIPE },
{ ERROR_PIPE_NOT_CONNECTED, EPIPE },
{ ERROR_OPERATION_ABORTED, EINTR },
{ ERROR_NOT_ENOUGH_QUOTA, ENOMEM }, { ERROR_NOT_ENOUGH_QUOTA, ENOMEM },
{ WSAENAMETOOLONG, ENAMETOOLONG }, { ERROR_MOD_NOT_FOUND, ENOENT },
{ WSAENOTEMPTY, ENOTEMPTY },
{ WSAEINTR, EINTR }, { WSAEINTR, EINTR },
{ WSAEBADF, EBADF }, { WSAEBADF, EBADF },
{ WSAEACCES, EACCES }, { WSAEACCES, EACCES },
{ WSAEFAULT, EFAULT }, { WSAEFAULT, EFAULT },
{ WSAEINVAL, EINVAL }, { WSAEINVAL, EINVAL },
{ WSAEMFILE, EMFILE }, { WSAEMFILE, EMFILE },
{ WSAEWOULDBLOCK, EWOULDBLOCK },
{ WSAEINPROGRESS, EINPROGRESS },
{ WSAEALREADY, EALREADY },
{ WSAENOTSOCK, ENOTSOCK },
{ WSAEDESTADDRREQ, EDESTADDRREQ },
{ WSAEMSGSIZE, EMSGSIZE },
{ WSAEPROTOTYPE, EPROTOTYPE },
{ WSAENOPROTOOPT, ENOPROTOOPT },
{ WSAEPROTONOSUPPORT, EPROTONOSUPPORT },
{ WSAESOCKTNOSUPPORT, ESOCKTNOSUPPORT },
{ WSAEOPNOTSUPP, EOPNOTSUPP },
{ WSAEPFNOSUPPORT, EPFNOSUPPORT },
{ WSAEAFNOSUPPORT, EAFNOSUPPORT },
{ WSAEADDRINUSE, EADDRINUSE },
{ WSAEADDRNOTAVAIL, EADDRNOTAVAIL },
{ WSAENETDOWN, ENETDOWN },
{ WSAENETUNREACH, ENETUNREACH },
{ WSAENETRESET, ENETRESET },
{ WSAECONNABORTED, ECONNABORTED },
{ WSAECONNRESET, ECONNRESET },
{ WSAENOBUFS, ENOBUFS },
{ WSAEISCONN, EISCONN },
{ WSAENOTCONN, ENOTCONN },
{ WSAESHUTDOWN, ESHUTDOWN },
{ WSAETOOMANYREFS, ETOOMANYREFS },
{ WSAETIMEDOUT, ETIMEDOUT },
{ WSAECONNREFUSED, ECONNREFUSED },
{ WSAELOOP, ELOOP },
{ WSAENAMETOOLONG, ENAMETOOLONG },
{ WSAEHOSTDOWN, EHOSTDOWN },
{ WSAEHOSTUNREACH, EHOSTUNREACH },
{ WSAEPROCLIM, EPROCLIM },
{ WSAENOTEMPTY, ENOTEMPTY },
{ WSAEUSERS, EUSERS },
{ WSAEDQUOT, EDQUOT },
{ WSAESTALE, ESTALE },
{ WSAEREMOTE, EREMOTE },
}; };
int int

View file

@ -333,43 +333,115 @@ extern char *rb_w32_strerror(int);
/* #undef va_end */ /* #undef va_end */
/* winsock error map */ /* winsock error map */
#define EWOULDBLOCK WSAEWOULDBLOCK #include <errno.h>
#define EINPROGRESS WSAEINPROGRESS
#define EALREADY WSAEALREADY #ifndef EWOULDBLOCK
#define ENOTSOCK WSAENOTSOCK # define EWOULDBLOCK WSAEWOULDBLOCK
#define EDESTADDRREQ WSAEDESTADDRREQ #endif
#define EMSGSIZE WSAEMSGSIZE #ifndef EINPROGRESS
#define EPROTOTYPE WSAEPROTOTYPE # define EINPROGRESS WSAEINPROGRESS
#define ENOPROTOOPT WSAENOPROTOOPT #endif
#define EPROTONOSUPPORT WSAEPROTONOSUPPORT #ifndef EALREADY
#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT # define EALREADY WSAEALREADY
#define EOPNOTSUPP WSAEOPNOTSUPP #endif
#define EPFNOSUPPORT WSAEPFNOSUPPORT #ifndef ENOTSOCK
#define EAFNOSUPPORT WSAEAFNOSUPPORT # define ENOTSOCK WSAENOTSOCK
#define EADDRINUSE WSAEADDRINUSE #endif
#define EADDRNOTAVAIL WSAEADDRNOTAVAIL #ifndef EDESTADDRREQ
#define ENETDOWN WSAENETDOWN # define EDESTADDRREQ WSAEDESTADDRREQ
#define ENETUNREACH WSAENETUNREACH #endif
#define ENETRESET WSAENETRESET #ifndef EMSGSIZE
#define ECONNABORTED WSAECONNABORTED # define EMSGSIZE WSAEMSGSIZE
#define ECONNRESET WSAECONNRESET #endif
#define ENOBUFS WSAENOBUFS #ifndef EPROTOTYPE
#define EISCONN WSAEISCONN # define EPROTOTYPE WSAEPROTOTYPE
#define ENOTCONN WSAENOTCONN #endif
#define ESHUTDOWN WSAESHUTDOWN #ifndef ENOPROTOOPT
#define ETOOMANYREFS WSAETOOMANYREFS # define ENOPROTOOPT WSAENOPROTOOPT
#define ETIMEDOUT WSAETIMEDOUT #endif
#define ECONNREFUSED WSAECONNREFUSED #ifndef EPROTONOSUPPORT
#define ELOOP WSAELOOP # define EPROTONOSUPPORT WSAEPROTONOSUPPORT
#endif
#ifndef ESOCKTNOSUPPORT
# define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
#endif
#ifndef EOPNOTSUPP
# define EOPNOTSUPP WSAEOPNOTSUPP
#endif
#ifndef EPFNOSUPPORT
# define EPFNOSUPPORT WSAEPFNOSUPPORT
#endif
#ifndef EAFNOSUPPORT
# define EAFNOSUPPORT WSAEAFNOSUPPORT
#endif
#ifndef EADDRINUSE
# define EADDRINUSE WSAEADDRINUSE
#endif
#ifndef EADDRNOTAVAIL
# define EADDRNOTAVAIL WSAEADDRNOTAVAIL
#endif
#ifndef ENETDOWN
# define ENETDOWN WSAENETDOWN
#endif
#ifndef ENETUNREACH
# define ENETUNREACH WSAENETUNREACH
#endif
#ifndef ENETRESET
# define ENETRESET WSAENETRESET
#endif
#ifndef ECONNABORTED
# define ECONNABORTED WSAECONNABORTED
#endif
#ifndef ECONNRESET
# define ECONNRESET WSAECONNRESET
#endif
#ifndef ENOBUFS
# define ENOBUFS WSAENOBUFS
#endif
#ifndef EISCONN
# define EISCONN WSAEISCONN
#endif
#ifndef ENOTCONN
# define ENOTCONN WSAENOTCONN
#endif
#ifndef ESHUTDOWN
# define ESHUTDOWN WSAESHUTDOWN
#endif
#ifndef ETOOMANYREFS
# define ETOOMANYREFS WSAETOOMANYREFS
#endif
#ifndef ETIMEDOUT
# define ETIMEDOUT WSAETIMEDOUT
#endif
#ifndef ECONNREFUSED
# define ECONNREFUSED WSAECONNREFUSED
#endif
#ifndef ELOOP
# define ELOOP WSAELOOP
#endif
/*#define ENAMETOOLONG WSAENAMETOOLONG*/ /*#define ENAMETOOLONG WSAENAMETOOLONG*/
#define EHOSTDOWN WSAEHOSTDOWN #ifndef EHOSTDOWN
#define EHOSTUNREACH WSAEHOSTUNREACH # define EHOSTDOWN WSAEHOSTDOWN
#endif
#ifndef EHOSTUNREACH
# define EHOSTUNREACH WSAEHOSTUNREACH
#endif
/*#define ENOTEMPTY WSAENOTEMPTY*/ /*#define ENOTEMPTY WSAENOTEMPTY*/
#define EPROCLIM WSAEPROCLIM #ifndef EPROCLIM
#define EUSERS WSAEUSERS # define EPROCLIM WSAEPROCLIM
#define EDQUOT WSAEDQUOT #endif
#define ESTALE WSAESTALE #ifndef EUSERS
#define EREMOTE WSAEREMOTE # define EUSERS WSAEUSERS
#endif
#ifndef EDQUOT
# define EDQUOT WSAEDQUOT
#endif
#ifndef ESTALE
# define ESTALE WSAESTALE
#endif
#ifndef EREMOTE
# define EREMOTE WSAEREMOTE
#endif
#define F_SETFL 1 #define F_SETFL 1
#define O_NONBLOCK 1 #define O_NONBLOCK 1