Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: fix windows constants to make them public for net.unix usage #20183

Merged
merged 1 commit into from
Dec 15, 2023

Conversation

GGRei
Copy link
Contributor

@GGRei GGRei commented Dec 15, 2023

Following this post: forum_discuss

It was not possible to use or compile code containing calls to the "net.unix" library on a Windows environment ( in my case, Windows 10). The errors encountered were:

v/vlib/net/unix/stream.c.v:73:54: error: constant 'net.msg_nosignal' is private
C.photon_send(c.sock.handle, ptr, remaining, net.msg_nosignal, c.write_timeout)

v/vlib/net/unix/stream.c.v:75:47: error: constant 'net.msg_nosignal' is private
C.send(c.sock.handle, ptr, remaining, net.msg_nosignal)

v/vlib/net/unix/stream.c.v:380:47: error: constant 'net.fionbio' is private
net.socket_error(C.ioctlsocket(handle, net.fionbio, &t))!

v/vlib/net/unix/stream.c.v:493:47: error: constant 'net.fionbio' is private
net.socket_error(C.ioctlsocket(sockfd, net.fionbio, &t))!

Test code to replicate the error:

module main

import net.unix

fn main() {
	println("test")
}

To address these issues, the affected constants have been made public in net_windows.c.v file.

I did not add a test file as merely importing 'net.unix' in the code was sufficient to trigger the previously mentioned errors. However, if required, I am ready to provide it.

@spytheman spytheman merged commit 0a029d4 into vlang:master Dec 15, 2023
42 checks passed
@GGRei GGRei deleted the fix_net-windows-constants branch December 25, 2023 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants