mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- Create optional with ~ instead of ?. return io::EOF?; becomes return io::EOF~.
- Deprecated use of `?` to create optional.
This commit is contained in:
@@ -66,8 +66,8 @@ macro void? NativeSocket.close(self)
|
||||
{
|
||||
if (libc::close(self))
|
||||
{
|
||||
if (libc::errno() == errno::EBADF) return net::INVALID_SOCKET?;
|
||||
return net::GENERAL_ERROR?;
|
||||
if (libc::errno() == errno::EBADF) return net::INVALID_SOCKET~;
|
||||
return net::GENERAL_ERROR~;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,8 +86,8 @@ macro void? NativeSocket.set_non_blocking(self, bool non_blocking)
|
||||
}
|
||||
if (fcntl(self, F_SETFL, flags) == -1)
|
||||
{
|
||||
if (libc::errno() == errno::EBADF) return net::INVALID_SOCKET?;
|
||||
return net::GENERAL_ERROR?;
|
||||
if (libc::errno() == errno::EBADF) return net::INVALID_SOCKET~;
|
||||
return net::GENERAL_ERROR~;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ macro void? start_wsa()
|
||||
if (wsa_error > 0)
|
||||
{
|
||||
mem::@atomic_store(wsa_init, 0);
|
||||
return os::socket_error()?;
|
||||
return os::socket_error()~;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -62,14 +62,14 @@ fn void? NativeSocket.set_non_blocking(self, bool non_blocking)
|
||||
{
|
||||
if (ioctlsocket(self, win32::FIONBIO, &&(CULong)non_blocking))
|
||||
{
|
||||
return socket_error()?;
|
||||
return socket_error()~;
|
||||
}
|
||||
}
|
||||
|
||||
macro void? NativeSocket.close(self)
|
||||
{
|
||||
WSAError error = closesocket(self);
|
||||
if (error) return convert_error(error)?;
|
||||
if (error) return convert_error(error)~;
|
||||
}
|
||||
|
||||
// https://github.com/wine-mirror/wine/blob/master/include/winsock.h
|
||||
|
||||
Reference in New Issue
Block a user