@@ -30,11 +30,11 @@ #ifndef NSPROTO_SPX # define NSPROTO_SPX 0 #endif -#define SPX_PACKET_TYPE 5 +static const uint8_t SPXPacketType = 5; @interface OFSPXSocket () - (int)of_createSocketForAddress: (const OFSocketAddress *)address errNo: (int *)errNo; - (bool)of_connectSocketToAddress: (const OFSocketAddress *)address @@ -325,11 +325,11 @@ if ((_socket = socket(address.sockaddr.sockaddr.sa_family, SOCK_SEQPACKET | SOCK_CLOEXEC, NSPROTO_SPX)) == OFInvalidSocketHandle) @throw [OFBindFailedException exceptionWithPort: port - packetType: SPX_PACKET_TYPE + packetType: SPXPacketType socket: self errNo: OFSocketErrNo()]; _canBlock = true; @@ -343,11 +343,11 @@ closesocket(_socket); _socket = OFInvalidSocketHandle; @throw [OFBindFailedException exceptionWithPort: port - packetType: SPX_PACKET_TYPE + packetType: SPXPacketType socket: self errNo: errNo]; } memset(&address, 0, sizeof(address)); @@ -360,23 +360,23 @@ closesocket(_socket); _socket = OFInvalidSocketHandle; @throw [OFBindFailedException exceptionWithPort: port - packetType: SPX_PACKET_TYPE + packetType: SPXPacketType socket: self errNo: errNo]; } if (address.sockaddr.sockaddr.sa_family != AF_IPX) { closesocket(_socket); _socket = OFInvalidSocketHandle; @throw [OFBindFailedException exceptionWithPort: port - packetType: SPX_PACKET_TYPE + packetType: SPXPacketType socket: self errNo: EAFNOSUPPORT]; } return address; } @end