ruby-changes:16227
From: usa <ko1@a...>
Date: Mon, 7 Jun 2010 18:20:23 +0900 (JST)
Subject: [ruby-changes:16227] Ruby:r28193 (ruby_1_8): * include/ruby/win32.h: include errno.h before defining errnos.
usa 2010-06-07 18:20:12 +0900 (Mon, 07 Jun 2010) New Revision: 28193 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=28193 Log: * 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). Modified files: branches/ruby_1_8/ChangeLog branches/ruby_1_8/win32/win32.c branches/ruby_1_8/win32/win32.h Index: ruby_1_8/ChangeLog =================================================================== --- ruby_1_8/ChangeLog (revision 28192) +++ ruby_1_8/ChangeLog (revision 28193) @@ -1,3 +1,13 @@ +Mon Jun 7 18:18:03 2010 NAKAMURA Usaku <usa@r...> + + * 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@r...> * regexp.c (re_compile_pattern): allow zero times match for Index: ruby_1_8/win32/win32.c =================================================================== --- ruby_1_8/win32/win32.c (revision 28192) +++ ruby_1_8/win32/win32.c (revision 28193) @@ -178,15 +178,60 @@ { ERROR_INFLOOP_IN_RELOC_CHAIN, ENOEXEC }, { ERROR_FILENAME_EXCED_RANGE, ENOENT }, { 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 }, - { WSAENAMETOOLONG, ENAMETOOLONG }, - { WSAENOTEMPTY, ENOTEMPTY }, + { ERROR_MOD_NOT_FOUND, ENOENT }, { WSAEINTR, EINTR }, { WSAEBADF, EBADF }, { WSAEACCES, EACCES }, { WSAEFAULT, EFAULT }, { WSAEINVAL, EINVAL }, { 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 Index: ruby_1_8/win32/win32.h =================================================================== --- ruby_1_8/win32/win32.h (revision 28192) +++ ruby_1_8/win32/win32.h (revision 28193) @@ -333,43 +333,115 @@ /* #undef va_end */ /* winsock error map */ -#define EWOULDBLOCK WSAEWOULDBLOCK -#define EINPROGRESS WSAEINPROGRESS -#define EALREADY WSAEALREADY -#define ENOTSOCK WSAENOTSOCK -#define EDESTADDRREQ WSAEDESTADDRREQ -#define EMSGSIZE WSAEMSGSIZE -#define EPROTOTYPE WSAEPROTOTYPE -#define ENOPROTOOPT WSAENOPROTOOPT -#define EPROTONOSUPPORT WSAEPROTONOSUPPORT -#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT -#define EOPNOTSUPP WSAEOPNOTSUPP -#define EPFNOSUPPORT WSAEPFNOSUPPORT -#define EAFNOSUPPORT WSAEAFNOSUPPORT -#define EADDRINUSE WSAEADDRINUSE -#define EADDRNOTAVAIL WSAEADDRNOTAVAIL -#define ENETDOWN WSAENETDOWN -#define ENETUNREACH WSAENETUNREACH -#define ENETRESET WSAENETRESET -#define ECONNABORTED WSAECONNABORTED -#define ECONNRESET WSAECONNRESET -#define ENOBUFS WSAENOBUFS -#define EISCONN WSAEISCONN -#define ENOTCONN WSAENOTCONN -#define ESHUTDOWN WSAESHUTDOWN -#define ETOOMANYREFS WSAETOOMANYREFS -#define ETIMEDOUT WSAETIMEDOUT -#define ECONNREFUSED WSAECONNREFUSED -#define ELOOP WSAELOOP +#include <errno.h> + +#ifndef EWOULDBLOCK +# define EWOULDBLOCK WSAEWOULDBLOCK +#endif +#ifndef EINPROGRESS +# define EINPROGRESS WSAEINPROGRESS +#endif +#ifndef EALREADY +# define EALREADY WSAEALREADY +#endif +#ifndef ENOTSOCK +# define ENOTSOCK WSAENOTSOCK +#endif +#ifndef EDESTADDRREQ +# define EDESTADDRREQ WSAEDESTADDRREQ +#endif +#ifndef EMSGSIZE +# define EMSGSIZE WSAEMSGSIZE +#endif +#ifndef EPROTOTYPE +# define EPROTOTYPE WSAEPROTOTYPE +#endif +#ifndef ENOPROTOOPT +# define ENOPROTOOPT WSAENOPROTOOPT +#endif +#ifndef EPROTONOSUPPORT +# 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 EHOSTDOWN WSAEHOSTDOWN -#define EHOSTUNREACH WSAEHOSTUNREACH +#ifndef EHOSTDOWN +# define EHOSTDOWN WSAEHOSTDOWN +#endif +#ifndef EHOSTUNREACH +# define EHOSTUNREACH WSAEHOSTUNREACH +#endif /*#define ENOTEMPTY WSAENOTEMPTY*/ -#define EPROCLIM WSAEPROCLIM -#define EUSERS WSAEUSERS -#define EDQUOT WSAEDQUOT -#define ESTALE WSAESTALE -#define EREMOTE WSAEREMOTE +#ifndef EPROCLIM +# define EPROCLIM WSAEPROCLIM +#endif +#ifndef EUSERS +# 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 O_NONBLOCK 1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/