- Create optional with ~ instead of ?. return io::EOF?; becomes return io::EOF~.

- Deprecated use of `?` to create optional.
This commit is contained in:
Christoffer Lerno
2026-01-20 16:10:28 +01:00
parent 5390ca6250
commit cdabe8fd9e
159 changed files with 710 additions and 707 deletions

View File

@@ -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~;
}
}

View File

@@ -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