aboutsummaryrefslogtreecommitdiff
path: root/lib/std/net.zig
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2020-11-22 10:29:45 +0100
committerLemonBoy <thatlemon@gmail.com>2021-01-11 21:43:15 +0100
commit34720da3d0a4a98383639cbedcbe1aa885217ed6 (patch)
tree183937da172d8cacda17a88df9a479bf4f2403ee /lib/std/net.zig
parentd0beb4badb9064893133c996b05c0748317adf24 (diff)
downloadzig-34720da3d0a4a98383639cbedcbe1aa885217ed6.tar.gz
zig-34720da3d0a4a98383639cbedcbe1aa885217ed6.zip
Apparently unix sockets are supported on Windows
Starting from Windows 10 build 17063.
Diffstat (limited to 'lib/std/net.zig')
-rw-r--r--lib/std/net.zig6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/std/net.zig b/lib/std/net.zig
index 41da4a2c46..6fe2d1cd08 100644
--- a/lib/std/net.zig
+++ b/lib/std/net.zig
@@ -12,7 +12,11 @@ const os = std.os;
const fs = std.fs;
const io = std.io;
-pub const has_unix_sockets = @hasDecl(os, "sockaddr_un");
+// Windows 10 added support for unix sockets in build 17063, redstone 4 is the
+// first release to support them.
+pub const has_unix_sockets = @hasDecl(os, "sockaddr_un") and
+ (builtin.os.tag != .windows or
+ std.Target.current.os.version_range.windows.isAtLeast(.win10_rs4) orelse false);
pub const Address = extern union {
any: os.sockaddr,