Overview
Comment: | Map WSA error codes to standard error codes. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
e790f0e1f0eafdfa32a281a3dafaffc2 |
User & Date: | js on 2013-07-05 16:54:02 |
Other Links: | manifest | tags |
Context
2013-07-05
| ||
20:02 | Warn if atomic ops AND spinlocks are missing. check-in: 2db4aee23f user: js tags: trunk | |
16:54 | Map WSA error codes to standard error codes. check-in: e790f0e1f0 user: js tags: trunk | |
2013-07-04
| ||
20:49 | Fix -[replaceCharactersInRange:withString:]. check-in: 4d892e0db1 user: js tags: trunk | |
Changes
Modified src/exceptions/OFAcceptFailedException.m from [1d660443ac] to [0b32311d32].
︙ | ︙ | |||
69 70 71 72 73 74 75 76 77 78 | - (OFTCPSocket*)socket { OF_GETTER(_socket, false) } - (int)errNo { return _errNo; } @end | > > > > | 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | - (OFTCPSocket*)socket { OF_GETTER(_socket, false) } - (int)errNo { #ifdef _WIN32 return of_wsaerr_to_errno(_errNo); #else return _errNo; #endif } @end |
Modified src/exceptions/OFAddressTranslationFailedException.m from [075dc3d4fd] to [c103e6dc5d].
︙ | ︙ | |||
113 114 115 116 117 118 119 120 121 122 | - (OFTCPSocket*)socket { OF_GETTER(_socket, false) } - (int)errNo { return _errNo; } @end | > > > > | 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | - (OFTCPSocket*)socket { OF_GETTER(_socket, false) } - (int)errNo { #ifdef _WIN32 return of_wsaerr_to_errno(_errNo); #else return _errNo; #endif } @end |
Modified src/exceptions/OFBindFailedException.m from [e9a7fb70cc] to [0685d3e4c2].
︙ | ︙ | |||
93 94 95 96 97 98 99 100 101 102 | - (OFTCPSocket*)socket { OF_GETTER(_socket, false) } - (int)errNo { return _errNo; } @end | > > > > | 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | - (OFTCPSocket*)socket { OF_GETTER(_socket, false) } - (int)errNo { #ifdef _WIN32 return of_wsaerr_to_errno(_errNo); #else return _errNo; #endif } @end |
Modified src/exceptions/OFConnectionFailedException.m from [6f870ca40c] to [4036f5e827].
︙ | ︙ | |||
94 95 96 97 98 99 100 101 102 103 | - (OFTCPSocket*)socket { OF_GETTER(_socket, false) } - (int)errNo { return _errNo; } @end | > > > > | 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | - (OFTCPSocket*)socket { OF_GETTER(_socket, false) } - (int)errNo { #ifdef _WIN32 return of_wsaerr_to_errno(_errNo); #else return _errNo; #endif } @end |
Modified src/exceptions/OFException.h from [2464e12597] to [f748681fbb].
︙ | ︙ | |||
17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #import "OFObject.h" @class OFString; @class OFArray; @class OFMutableArray; #define OF_BACKTRACE_SIZE 32 /*! * @brief The base class for all exceptions in ObjFW * * The OFException class is the base class for all exceptions in ObjFW, except * the OFAllocFailedException. */ | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | #import "OFObject.h" @class OFString; @class OFArray; @class OFMutableArray; #define OF_BACKTRACE_SIZE 32 #if defined(_WIN32) && defined(OF_HAVE_SOCKETS) # define EADDRINUSE WSAEADDRINUSE # define EADDRNOTAVAIL WSAEADDRNOTAVAIL # define EAFNOSUPPORT WSAEAFNOSUPPORT # define EALREADY WSAEALREADY # define ECONNABORTED WSAECONNABORTED # define ECONNABORTED WSAECONNABORTED # define ECONNREFUSED WSAECONNREFUSED # define ECONNRESET WSAECONNRESET # define ECONNRESET WSAECONNRESET # define EDESTADDRREQ WSAEDESTADDRREQ # define EDQUOT WSAEDQUOT # define EHOSTDOWN WSAEHOSTDOWN # define EHOSTUNREACH WSAEHOSTUNREACH # define EINPROGRESS WSAEINPROGRESS # define EISCONN WSAEISCONN # define ELOOP WSAELOOP # define EMSGSIZE WSAEMSGSIZE # define ENETDOWN WSAENETDOWN # define ENETRESET WSAENETRESET # define ENETUNREACH WSAENETUNREACH # define ENOBUFS WSAENOBUFS # define ENOPROTOOPT WSAENOPROTOOPT # define ENOTCONN WSAENOTCONN # define ENOTSOCK WSAENOTSOCK # define EOPNOTSUPP WSAEOPNOTSUPP # define EPFNOSUPPORT WSAEPFNOSUPPORT # define EPROCLIM WSAEPROCLIM # define EPROTONOSUPPORT WSAEPROTONOSUPPORT # define EPROTOTYPE WSAEPROTOTYPE # define EREMOTE WSAEREMOTE # define ESHUTDOWN WSAESHUTDOWN # define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT # define ESTALE WSAESTALE # define ETIMEDOUT WSAETIMEDOUT # define ETOOMANYREFS WSAETOOMANYREFS # define EUSERS WSAEUSERS # define EWOULDBLOCK WSAEWOULDBLOCK extern int of_wsaerr_to_errno(int); #endif /*! * @brief The base class for all exceptions in ObjFW * * The OFException class is the base class for all exceptions in ObjFW, except * the OFAllocFailedException. */ |
︙ | ︙ |
Modified src/exceptions/OFException.m from [ab1bc6e29e] to [bf88fcb9d3].
︙ | ︙ | |||
25 26 27 28 29 30 31 32 33 34 35 36 37 38 | #endif #import "OFException.h" #import "OFString.h" #import "OFArray.h" #import "autorelease.h" struct _Unwind_Context; typedef enum { _URC_OK = 0, _URC_END_OF_STACK = 5 }_Unwind_Reason_Code; | > > > > > | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | #endif #import "OFException.h" #import "OFString.h" #import "OFArray.h" #import "autorelease.h" #ifdef _WIN32 # include <errno.h> # include <winerror.h> #endif struct _Unwind_Context; typedef enum { _URC_OK = 0, _URC_END_OF_STACK = 5 }_Unwind_Reason_Code; |
︙ | ︙ | |||
64 65 66 67 68 69 70 71 72 73 74 75 76 77 | bt->backtrace[bt->i++] = (void*)_Unwind_GetIP(ctx); #endif return _URC_OK; } return _URC_END_OF_STACK; } @implementation OFException + (instancetype)exception { return [[[self alloc] init] autorelease]; } | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | bt->backtrace[bt->i++] = (void*)_Unwind_GetIP(ctx); #endif return _URC_OK; } return _URC_END_OF_STACK; } #if defined(_WIN32) && defined(OF_HAVE_SOCKETS) int of_wsaerr_to_errno(int wsaerr) { switch (wsaerr) { case WSAEACCES: return EACCES; case WSAEBADF: return EBADF; case WSAEDISCON: return EPIPE; case WSAEFAULT: return EFAULT; case WSAEINTR: return EINTR; case WSAEINVAL: return EINVAL; case WSAENAMETOOLONG: return ENAMETOOLONG; case WSAENOTEMPTY: return ENOTEMPTY; case WSAEWOULDBLOCK: return EAGAIN; default: return wsaerr; } } #endif @implementation OFException + (instancetype)exception { return [[[self alloc] init] autorelease]; } |
︙ | ︙ |
Modified src/exceptions/OFListenFailedException.m from [826b1a07e4] to [0f57a25169].
︙ | ︙ | |||
78 79 80 81 82 83 84 85 86 87 | - (int)backLog { return _backLog; } - (int)errNo { return _errNo; } @end | > > > > | 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | - (int)backLog { return _backLog; } - (int)errNo { #ifdef _WIN32 return of_wsaerr_to_errno(_errNo); #else return _errNo; #endif } @end |
Modified src/exceptions/OFReadOrWriteFailedException.m from [4ce61d5ebe] to [32fe9f37fd].
︙ | ︙ | |||
87 88 89 90 91 92 93 94 95 96 | - (size_t)requestedLength { return _requestedLength; } - (int)errNo { return _errNo; } @end | > > > > | 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | - (size_t)requestedLength { return _requestedLength; } - (int)errNo { #ifdef _WIN32 return of_wsaerr_to_errno(_errNo); #else return _errNo; #endif } @end |