mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Updated indentation to C3 standard.
This commit is contained in:
@@ -16,11 +16,11 @@ struct AddrInfo
|
||||
struct @if(env::WIN32 || env::DARWIN)
|
||||
{
|
||||
ZString ai_canonname;
|
||||
SockAddrPtr ai_addr;
|
||||
SockAddrPtr ai_addr;
|
||||
}
|
||||
struct @if(env::LINUX)
|
||||
{
|
||||
SockAddrPtr ai_addr;
|
||||
SockAddrPtr ai_addr;
|
||||
ZString ai_canonname;
|
||||
}
|
||||
AddrInfo* ai_next;
|
||||
|
||||
@@ -25,7 +25,7 @@ macro void! NativeSocket.close(self)
|
||||
macro void! NativeSocket.set_non_blocking(self)
|
||||
{
|
||||
int flags = fcntl(self, F_GETFL, 0);
|
||||
if (fcntl(self, F_SETFL, flags | O_NONBLOCK) == -1)
|
||||
if (fcntl(self, F_SETFL, flags | O_NONBLOCK) == -1)
|
||||
{
|
||||
if (libc::errno() == errno::EBADF) return NetError.INVALID_SOCKET?;
|
||||
return NetError.GENERAL_ERROR?;
|
||||
|
||||
@@ -19,11 +19,11 @@ extern fn NativeSocket accept(NativeSocket, SockAddrPtr address, Socklen_t* addr
|
||||
|
||||
macro NativeSocket.close(self)
|
||||
{
|
||||
if (int err = closesocket(self))
|
||||
{
|
||||
if (err == WSAENOTSOCK) return NetError.INVALID_SOCKET?;
|
||||
if (int err = closesocket(self))
|
||||
{
|
||||
if (err == WSAENOTSOCK) return NetError.INVALID_SOCKET?;
|
||||
return NetError.GENERAL_ERROR?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const int WSAENOTSOCK = 10038;
|
||||
|
||||
Reference in New Issue
Block a user