@zigc/lib 0.16.0-dev.3144 → 0.16.0-dev.3153

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/std/c.zig CHANGED
@@ -3721,14 +3721,14 @@ pub const W = switch (native_os) {
3721
3721
  pub fn TERMSIG(x: u32) SIG {
3722
3722
  return @enumFromInt(status(x));
3723
3723
  }
3724
- pub fn STOPSIG(x: u32) u32 {
3725
- return x >> 8;
3724
+ pub fn STOPSIG(x: u32) SIG {
3725
+ return @enumFromInt(x >> 8);
3726
3726
  }
3727
3727
  pub fn IFEXITED(x: u32) bool {
3728
3728
  return status(x) == 0;
3729
3729
  }
3730
3730
  pub fn IFSTOPPED(x: u32) bool {
3731
- return status(x) == stopped and STOPSIG(x) != 0x13;
3731
+ return status(x) == stopped and @as(u32, @intFromEnum(STOPSIG(x))) != 0x13;
3732
3732
  }
3733
3733
  pub fn IFSIGNALED(x: u32) bool {
3734
3734
  return status(x) != stopped and status(x) != 0;
@@ -3754,8 +3754,8 @@ pub const W = switch (native_os) {
3754
3754
  pub fn TERMSIG(s: u32) SIG {
3755
3755
  return @enumFromInt(s & 0x7f);
3756
3756
  }
3757
- pub fn STOPSIG(s: u32) u32 {
3758
- return EXITSTATUS(s);
3757
+ pub fn STOPSIG(s: u32) SIG {
3758
+ return @enumFromInt(EXITSTATUS(s));
3759
3759
  }
3760
3760
  pub fn IFEXITED(s: u32) bool {
3761
3761
  return (s & 0x7f) == 0;
@@ -3782,8 +3782,8 @@ pub const W = switch (native_os) {
3782
3782
  pub fn TERMSIG(s: u32) SIG {
3783
3783
  return @enumFromInt(s & 0x7f);
3784
3784
  }
3785
- pub fn STOPSIG(s: u32) u32 {
3786
- return EXITSTATUS(s);
3785
+ pub fn STOPSIG(s: u32) SIG {
3786
+ return @enumFromInt(EXITSTATUS(s));
3787
3787
  }
3788
3788
  pub fn IFEXITED(s: u32) bool {
3789
3789
  return (s & 0x7f) == 0;
@@ -3816,8 +3816,8 @@ pub const W = switch (native_os) {
3816
3816
  pub fn TERMSIG(s: u32) SIG {
3817
3817
  return @enumFromInt(s & 0x7f);
3818
3818
  }
3819
- pub fn STOPSIG(s: u32) u32 {
3820
- return EXITSTATUS(s);
3819
+ pub fn STOPSIG(s: u32) SIG {
3820
+ return @enumFromInt(EXITSTATUS(s));
3821
3821
  }
3822
3822
  pub fn IFEXITED(s: u32) bool {
3823
3823
  return (s & 0x7f) == 0;
@@ -3850,8 +3850,8 @@ pub const W = switch (native_os) {
3850
3850
  pub fn TERMSIG(s: u32) SIG {
3851
3851
  return @enumFromInt(s & 0x7f);
3852
3852
  }
3853
- pub fn STOPSIG(s: u32) u32 {
3854
- return EXITSTATUS(s);
3853
+ pub fn STOPSIG(s: u32) SIG {
3854
+ return @enumFromInt(EXITSTATUS(s));
3855
3855
  }
3856
3856
  pub fn IFEXITED(s: u32) bool {
3857
3857
  return (s & 0x7f) == 0;
@@ -3879,8 +3879,8 @@ pub const W = switch (native_os) {
3879
3879
  return @enumFromInt((s >> 8) & 0xff);
3880
3880
  }
3881
3881
 
3882
- pub fn STOPSIG(s: u32) u32 {
3883
- return (s >> 16) & 0xff;
3882
+ pub fn STOPSIG(s: u32) SIG {
3883
+ return @enumFromInt((s >> 16) & 0xff);
3884
3884
  }
3885
3885
 
3886
3886
  pub fn IFEXITED(s: u32) bool {
@@ -3906,8 +3906,8 @@ pub const W = switch (native_os) {
3906
3906
  pub fn TERMSIG(s: u32) SIG {
3907
3907
  return @enumFromInt(s & 0x7f);
3908
3908
  }
3909
- pub fn STOPSIG(s: u32) u32 {
3910
- return EXITSTATUS(s);
3909
+ pub fn STOPSIG(s: u32) SIG {
3910
+ return @enumFromInt(EXITSTATUS(s));
3911
3911
  }
3912
3912
  pub fn IFEXITED(s: u32) bool {
3913
3913
  return (s & 0x7f) == 0;
@@ -3938,8 +3938,8 @@ pub const W = switch (native_os) {
3938
3938
  return @intCast((s & 0xff00) >> 8);
3939
3939
  }
3940
3940
 
3941
- pub fn STOPSIG(s: u32) u32 {
3942
- return EXITSTATUS(s);
3941
+ pub fn STOPSIG(s: u32) SIG {
3942
+ return @enumFromInt(EXITSTATUS(s));
3943
3943
  }
3944
3944
 
3945
3945
  pub fn TERMSIG(s: u32) SIG {
@@ -770,9 +770,9 @@ fn testBasicWriteStream(w: *Stringify) !void {
770
770
  }
771
771
 
772
772
  fn getJsonObject(allocator: std.mem.Allocator) !std.json.Value {
773
- var v: std.json.Value = .{ .object = std.json.ObjectMap.init(allocator) };
774
- try v.object.put("one", std.json.Value{ .integer = @as(i64, @intCast(1)) });
775
- try v.object.put("two", std.json.Value{ .float = 2.0 });
773
+ var v: std.json.Value = .{ .object = .empty };
774
+ try v.object.put(allocator, "one", std.json.Value{ .integer = @as(i64, @intCast(1)) });
775
+ try v.object.put(allocator, "two", std.json.Value{ .float = 2.0 });
776
776
  return v;
777
777
  }
778
778
 
@@ -1,7 +1,7 @@
1
1
  const std = @import("std");
2
2
  const debug = std.debug;
3
3
  const ArenaAllocator = std.heap.ArenaAllocator;
4
- const StringArrayHashMap = std.StringArrayHashMap;
4
+ const StringArrayHashMap = std.array_hash_map.String;
5
5
  const Allocator = std.mem.Allocator;
6
6
  const json = std.json;
7
7
 
@@ -103,10 +103,10 @@ pub const Value = union(enum) {
103
103
 
104
104
  .object_begin => {
105
105
  switch (try source.nextAllocMax(allocator, .alloc_always, options.max_value_len.?)) {
106
- .object_end => return try handleCompleteValue(&stack, allocator, source, Value{ .object = ObjectMap.init(allocator) }, options) orelse continue,
106
+ .object_end => return try handleCompleteValue(&stack, allocator, source, Value{ .object = .empty }, options) orelse continue,
107
107
  .allocated_string => |key| {
108
108
  try stack.appendSlice(&[_]Value{
109
- Value{ .object = ObjectMap.init(allocator) },
109
+ Value{ .object = .empty },
110
110
  Value{ .string = key },
111
111
  });
112
112
  },
@@ -145,7 +145,7 @@ fn handleCompleteValue(stack: *Array, allocator: Allocator, source: anytype, val
145
145
  // stack: [..., .object]
146
146
  var object = &stack.items[stack.items.len - 1].object;
147
147
 
148
- const gop = try object.getOrPut(key);
148
+ const gop = try object.getOrPut(allocator, key);
149
149
  if (gop.found_existing) {
150
150
  switch (options.duplicate_field_behavior) {
151
151
  .use_first => {},
@@ -212,7 +212,7 @@ pub const W = struct {
212
212
  return @enumFromInt(s & 0x7f);
213
213
  }
214
214
  pub fn STOPSIG(s: u32) u32 {
215
- return EXITSTATUS(s);
215
+ return @enumFromInt(EXITSTATUS(s));
216
216
  }
217
217
  pub fn IFEXITED(s: u32) bool {
218
218
  return (s & 0x7f) == 0;
package/std/os/linux.zig CHANGED
@@ -3883,8 +3883,8 @@ pub const W = struct {
3883
3883
  pub fn TERMSIG(s: u32) SIG {
3884
3884
  return @enumFromInt(s & 0x7f);
3885
3885
  }
3886
- pub fn STOPSIG(s: u32) u32 {
3887
- return EXITSTATUS(s);
3886
+ pub fn STOPSIG(s: u32) SIG {
3887
+ return @enumFromInt(EXITSTATUS(s));
3888
3888
  }
3889
3889
  pub fn IFEXITED(s: u32) bool {
3890
3890
  return (s & 0x7f) == 0;
@@ -94,7 +94,7 @@ pub const ResourceUsageStatistics = struct {
94
94
  pub const Term = union(enum) {
95
95
  exited: u8,
96
96
  signal: std.posix.SIG,
97
- stopped: u32,
97
+ stopped: std.posix.SIG,
98
98
  unknown: u32,
99
99
  };
100
100
 
package/std/std.zig CHANGED
@@ -1,7 +1,3 @@
1
- pub const ArrayHashMap = array_hash_map.ArrayHashMap;
2
- pub const ArrayHashMapUnmanaged = array_hash_map.ArrayHashMapUnmanaged;
3
- pub const AutoArrayHashMap = array_hash_map.AutoArrayHashMap;
4
- pub const AutoArrayHashMapUnmanaged = array_hash_map.AutoArrayHashMapUnmanaged;
5
1
  pub const AutoHashMap = hash_map.AutoHashMap;
6
2
  pub const AutoHashMapUnmanaged = hash_map.AutoHashMapUnmanaged;
7
3
  pub const BitStack = @import("BitStack.zig");
@@ -31,14 +27,19 @@ pub const SinglyLinkedList = @import("SinglyLinkedList.zig");
31
27
  pub const StaticBitSet = bit_set.StaticBitSet;
32
28
  pub const StringHashMap = hash_map.StringHashMap;
33
29
  pub const StringHashMapUnmanaged = hash_map.StringHashMapUnmanaged;
34
- pub const StringArrayHashMap = array_hash_map.StringArrayHashMap;
35
- pub const StringArrayHashMapUnmanaged = array_hash_map.StringArrayHashMapUnmanaged;
36
30
  pub const Target = @import("Target.zig");
37
31
  pub const Thread = @import("Thread.zig");
38
32
  pub const Treap = @import("treap.zig").Treap;
39
33
  pub const Tz = tz.Tz;
40
34
  pub const Uri = @import("Uri.zig");
41
35
 
36
+ /// Deprecated; use `array_hash_map.Custom`.
37
+ pub const ArrayHashMapUnmanaged = array_hash_map.Custom;
38
+ /// Deprecated; use `array_hash_map.Auto`.
39
+ pub const AutoArrayHashMapUnmanaged = array_hash_map.Auto;
40
+ /// Deprecated; use `array_hash_map.String`.
41
+ pub const StringArrayHashMapUnmanaged = array_hash_map.String;
42
+
42
43
  /// A contiguous, growable list of items in memory. This is a wrapper around a
43
44
  /// slice of `T` values.
44
45
  ///
@@ -1779,8 +1779,8 @@ fn structInitExpr(
1779
1779
  var sfba = std.heap.stackFallback(256, astgen.arena);
1780
1780
  const sfba_allocator = sfba.get();
1781
1781
 
1782
- var duplicate_names = std.AutoArrayHashMap(Zir.NullTerminatedString, ArrayList(Ast.TokenIndex)).init(sfba_allocator);
1783
- try duplicate_names.ensureTotalCapacity(@intCast(struct_init.ast.fields.len));
1782
+ var duplicate_names: std.array_hash_map.Auto(Zir.NullTerminatedString, ArrayList(Ast.TokenIndex)) = .empty;
1783
+ try duplicate_names.ensureTotalCapacity(sfba_allocator, @intCast(struct_init.ast.fields.len));
1784
1784
 
1785
1785
  // When there aren't errors, use this to avoid a second iteration.
1786
1786
  var any_duplicate = false;
@@ -1789,7 +1789,7 @@ fn structInitExpr(
1789
1789
  const name_token = tree.firstToken(field) - 2;
1790
1790
  const name_index = try astgen.identAsString(name_token);
1791
1791
 
1792
- const gop = try duplicate_names.getOrPut(name_index);
1792
+ const gop = try duplicate_names.getOrPut(sfba_allocator, name_index);
1793
1793
 
1794
1794
  if (gop.found_existing) {
1795
1795
  try gop.value_ptr.append(sfba_allocator, name_token);
@@ -1185,11 +1185,25 @@ fn detectAndroidApiLevel(io: Io) !u32 {
1185
1185
  return error.ApiLevelQueryFailed;
1186
1186
  };
1187
1187
 
1188
- const term = try child.wait(io);
1189
- if (term != .exited or term.exited != 0) {
1190
- std.log.err("getprop terminated abnormally: {}", .{term});
1191
- return error.ApiLevelQueryFailed;
1188
+ switch (try child.wait(io)) {
1189
+ .exited => |code| if (code != 0) {
1190
+ std.log.err("getprop terminated abnormally with exit code: {d}", .{code});
1191
+ return error.ApiLevelQueryFailed;
1192
+ },
1193
+ .signal => |sig| {
1194
+ std.log.err("getprop terminated abnormally with signal: {t}", .{sig});
1195
+ return error.ApiLevelQueryFailed;
1196
+ },
1197
+ .stopped => |sig| {
1198
+ std.log.err("getprop stopped abnormally with signal: {t}", .{sig});
1199
+ return error.ApiLevelQueryFailed;
1200
+ },
1201
+ .unknown => {
1202
+ std.log.err("getprop terminated abnormally", .{});
1203
+ return error.ApiLevelQueryFailed;
1204
+ },
1192
1205
  }
1206
+
1193
1207
  return api_level;
1194
1208
  }
1195
1209