@zigc/lib 0.16.0-dev.3133 → 0.16.0-dev.3142
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/std/Build/Step/ConfigHeader.zig +12 -2
- package/std/Io/Threaded.zig +10 -2
- package/std/Io.zig +7 -0
- package/std/builtin/assembly.zig +68 -0
- package/std/enums.zig +12 -0
- package/std/os/emscripten.zig +0 -16
- package/std/posix.zig +4 -0
package/package.json
CHANGED
|
@@ -420,12 +420,21 @@ fn render_cmake(
|
|
|
420
420
|
};
|
|
421
421
|
defer allocator.free(line);
|
|
422
422
|
|
|
423
|
-
|
|
423
|
+
const line_start = std.mem.findNone(u8, line, " \t\r") orelse {
|
|
424
|
+
try bw.writeAll(line);
|
|
425
|
+
if (!last_line) try bw.writeByte('\n');
|
|
426
|
+
continue;
|
|
427
|
+
};
|
|
428
|
+
const whitespace_prefix = line[0..line_start];
|
|
429
|
+
const trimmed_line = line[line_start..];
|
|
430
|
+
|
|
431
|
+
if (!std.mem.startsWith(u8, trimmed_line, "#")) {
|
|
424
432
|
try bw.writeAll(line);
|
|
425
433
|
if (!last_line) try bw.writeByte('\n');
|
|
426
434
|
continue;
|
|
427
435
|
}
|
|
428
|
-
|
|
436
|
+
|
|
437
|
+
var it = std.mem.tokenizeAny(u8, trimmed_line[1..], " \t\r");
|
|
429
438
|
const cmakedefine = it.next().?;
|
|
430
439
|
if (!std.mem.eql(u8, cmakedefine, "cmakedefine") and
|
|
431
440
|
!std.mem.eql(u8, cmakedefine, "cmakedefine01"))
|
|
@@ -502,6 +511,7 @@ fn render_cmake(
|
|
|
502
511
|
value = Value{ .ident = it.rest() };
|
|
503
512
|
}
|
|
504
513
|
|
|
514
|
+
try bw.writeAll(whitespace_prefix);
|
|
505
515
|
try renderValueC(bw, name, value);
|
|
506
516
|
}
|
|
507
517
|
|
package/std/Io/Threaded.zig
CHANGED
|
@@ -6090,12 +6090,19 @@ fn dirRealPathFileWindows(userdata: ?*anyopaque, dir: Dir, sub_path: []const u8,
|
|
|
6090
6090
|
}
|
|
6091
6091
|
};
|
|
6092
6092
|
defer windows.CloseHandle(h_file);
|
|
6093
|
-
|
|
6093
|
+
|
|
6094
|
+
// We can re-use the path buffer for the WTF-16 representation since
|
|
6095
|
+
// we don't need the prefixed path anymore
|
|
6096
|
+
return realPathWindowsBuf(h_file, out_buffer, &path_name_w.data);
|
|
6094
6097
|
}
|
|
6095
6098
|
|
|
6096
6099
|
fn realPathWindows(h_file: windows.HANDLE, out_buffer: []u8) File.RealPathError!usize {
|
|
6097
6100
|
var wide_buf: [windows.PATH_MAX_WIDE]u16 = undefined;
|
|
6098
|
-
|
|
6101
|
+
return realPathWindowsBuf(h_file, out_buffer, &wide_buf);
|
|
6102
|
+
}
|
|
6103
|
+
|
|
6104
|
+
fn realPathWindowsBuf(h_file: windows.HANDLE, out_buffer: []u8, wtf16_buffer: []u16) File.RealPathError!usize {
|
|
6105
|
+
const wide_slice = try GetFinalPathNameByHandle(h_file, .{}, wtf16_buffer);
|
|
6099
6106
|
|
|
6100
6107
|
const len = std.unicode.calcWtf8Len(wide_slice);
|
|
6101
6108
|
if (len > out_buffer.len)
|
|
@@ -13010,6 +13017,7 @@ fn netReceiveOneWindows(
|
|
|
13010
13017
|
.CANCELLED => unreachable,
|
|
13011
13018
|
.INSUFFICIENT_RESOURCES => return error.SystemResources,
|
|
13012
13019
|
.BUFFER_OVERFLOW => return error.MessageOversize,
|
|
13020
|
+
.PORT_UNREACHABLE => return error.PortUnreachable,
|
|
13013
13021
|
else => |status| return windows.unexpectedStatus(status),
|
|
13014
13022
|
}
|
|
13015
13023
|
}
|
package/std/Io.zig
CHANGED
|
@@ -374,6 +374,13 @@ pub const Operation = union(enum) {
|
|
|
374
374
|
ConnectionResetByPeer,
|
|
375
375
|
/// The local network interface used to reach the destination is offline.
|
|
376
376
|
NetworkDown,
|
|
377
|
+
/// A connectionless packet was previously sent successfully,
|
|
378
|
+
/// however, it was not received because no service is operating at
|
|
379
|
+
/// the destination port of the transport on the remote system.
|
|
380
|
+
/// This caused an ICMP port unreachable packet to be returned to
|
|
381
|
+
/// the OS where it was queued up to be reported at the next call
|
|
382
|
+
/// to send or receive on the bound socket.
|
|
383
|
+
PortUnreachable,
|
|
377
384
|
} || Io.UnexpectedError;
|
|
378
385
|
|
|
379
386
|
pub const Result = struct { ?net.Socket.ReceiveError, usize };
|
package/std/builtin/assembly.zig
CHANGED
|
@@ -682,6 +682,40 @@ pub const Clobbers = switch (@import("builtin").cpu.arch) {
|
|
|
682
682
|
x30: bool = false,
|
|
683
683
|
x31: bool = false,
|
|
684
684
|
|
|
685
|
+
// ABI aliases for integer registers
|
|
686
|
+
ra: bool = false,
|
|
687
|
+
sp: bool = false,
|
|
688
|
+
gp: bool = false,
|
|
689
|
+
tp: bool = false,
|
|
690
|
+
t0: bool = false,
|
|
691
|
+
t1: bool = false,
|
|
692
|
+
t2: bool = false,
|
|
693
|
+
s0: bool = false,
|
|
694
|
+
fp: bool = false,
|
|
695
|
+
s1: bool = false,
|
|
696
|
+
a0: bool = false,
|
|
697
|
+
a1: bool = false,
|
|
698
|
+
a2: bool = false,
|
|
699
|
+
a3: bool = false,
|
|
700
|
+
a4: bool = false,
|
|
701
|
+
a5: bool = false,
|
|
702
|
+
a6: bool = false,
|
|
703
|
+
a7: bool = false,
|
|
704
|
+
s2: bool = false,
|
|
705
|
+
s3: bool = false,
|
|
706
|
+
s4: bool = false,
|
|
707
|
+
s5: bool = false,
|
|
708
|
+
s6: bool = false,
|
|
709
|
+
s7: bool = false,
|
|
710
|
+
s8: bool = false,
|
|
711
|
+
s9: bool = false,
|
|
712
|
+
s10: bool = false,
|
|
713
|
+
s11: bool = false,
|
|
714
|
+
t3: bool = false,
|
|
715
|
+
t4: bool = false,
|
|
716
|
+
t5: bool = false,
|
|
717
|
+
t6: bool = false,
|
|
718
|
+
|
|
685
719
|
fflags: bool = false,
|
|
686
720
|
frm: bool = false,
|
|
687
721
|
|
|
@@ -718,6 +752,40 @@ pub const Clobbers = switch (@import("builtin").cpu.arch) {
|
|
|
718
752
|
f30: bool = false,
|
|
719
753
|
f31: bool = false,
|
|
720
754
|
|
|
755
|
+
// ABI aliases for float registers
|
|
756
|
+
ft0: bool = false,
|
|
757
|
+
ft1: bool = false,
|
|
758
|
+
ft2: bool = false,
|
|
759
|
+
ft3: bool = false,
|
|
760
|
+
ft4: bool = false,
|
|
761
|
+
ft5: bool = false,
|
|
762
|
+
ft6: bool = false,
|
|
763
|
+
ft7: bool = false,
|
|
764
|
+
fs0: bool = false,
|
|
765
|
+
fs1: bool = false,
|
|
766
|
+
fa0: bool = false,
|
|
767
|
+
fa1: bool = false,
|
|
768
|
+
fa2: bool = false,
|
|
769
|
+
fa3: bool = false,
|
|
770
|
+
fa4: bool = false,
|
|
771
|
+
fa5: bool = false,
|
|
772
|
+
fa6: bool = false,
|
|
773
|
+
fa7: bool = false,
|
|
774
|
+
fs2: bool = false,
|
|
775
|
+
fs3: bool = false,
|
|
776
|
+
fs4: bool = false,
|
|
777
|
+
fs5: bool = false,
|
|
778
|
+
fs6: bool = false,
|
|
779
|
+
fs7: bool = false,
|
|
780
|
+
fs8: bool = false,
|
|
781
|
+
fs9: bool = false,
|
|
782
|
+
fs10: bool = false,
|
|
783
|
+
fs11: bool = false,
|
|
784
|
+
ft8: bool = false,
|
|
785
|
+
ft9: bool = false,
|
|
786
|
+
ft10: bool = false,
|
|
787
|
+
ft11: bool = false,
|
|
788
|
+
|
|
721
789
|
vtype: bool = false,
|
|
722
790
|
vl: bool = false,
|
|
723
791
|
vxsat: bool = false,
|
package/std/enums.zig
CHANGED
|
@@ -284,6 +284,18 @@ pub fn EnumSet(comptime E: type) type {
|
|
|
284
284
|
/// A set containing all possible keys.
|
|
285
285
|
pub const full: Self = .{ .bits = .full };
|
|
286
286
|
|
|
287
|
+
/// Deprecated: use `.empty`.
|
|
288
|
+
/// Returns a set containing no keys.
|
|
289
|
+
pub fn initEmpty() Self {
|
|
290
|
+
return .empty;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/// Deprecated: use `.full`.
|
|
294
|
+
/// Returns a set containing all possible keys.
|
|
295
|
+
pub fn initFull() Self {
|
|
296
|
+
return .full;
|
|
297
|
+
}
|
|
298
|
+
|
|
287
299
|
/// Returns a set containing multiple keys.
|
|
288
300
|
pub fn initMany(keys: []const Key) Self {
|
|
289
301
|
var set: Self = .empty;
|
package/std/os/emscripten.zig
CHANGED
|
@@ -11,22 +11,6 @@ const c = std.c;
|
|
|
11
11
|
|
|
12
12
|
pub const FILE = c.FILE;
|
|
13
13
|
|
|
14
|
-
var __stack_chk_guard: usize = 0;
|
|
15
|
-
fn __stack_chk_fail() callconv(.c) void {
|
|
16
|
-
std.debug.print("stack smashing detected: terminated\n", .{});
|
|
17
|
-
emscripten_force_exit(127);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
comptime {
|
|
21
|
-
if (builtin.os.tag == .emscripten) {
|
|
22
|
-
if (builtin.mode == .Debug or builtin.mode == .ReleaseSafe) {
|
|
23
|
-
// Emscripten does not provide these symbols, so we must export our own
|
|
24
|
-
@export(&__stack_chk_guard, .{ .name = "__stack_chk_guard", .linkage = .strong });
|
|
25
|
-
@export(&__stack_chk_fail, .{ .name = "__stack_chk_fail", .linkage = .strong });
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
14
|
pub const PF = linux.PF;
|
|
31
15
|
pub const AF = linux.AF;
|
|
32
16
|
pub const CLOCK = linux.CLOCK;
|
package/std/posix.zig
CHANGED
|
@@ -513,6 +513,9 @@ pub const GetSockNameError = error{
|
|
|
513
513
|
SocketNotBound,
|
|
514
514
|
|
|
515
515
|
FileDescriptorNotASocket,
|
|
516
|
+
|
|
517
|
+
/// The socket is not connected (connection-oriented sockets only).
|
|
518
|
+
SocketUnconnected,
|
|
516
519
|
} || UnexpectedError;
|
|
517
520
|
|
|
518
521
|
pub fn getpeername(sock: socket_t, addr: *sockaddr, addrlen: *socklen_t) GetSockNameError!void {
|
|
@@ -529,6 +532,7 @@ pub fn getpeername(sock: socket_t, addr: *sockaddr, addrlen: *socklen_t) GetSock
|
|
|
529
532
|
.INVAL => unreachable, // invalid parameters
|
|
530
533
|
.NOTSOCK => return error.FileDescriptorNotASocket,
|
|
531
534
|
.NOBUFS => return error.SystemResources,
|
|
535
|
+
.NOTCONN => return error.SocketUnconnected,
|
|
532
536
|
}
|
|
533
537
|
}
|
|
534
538
|
}
|