File tree Expand file tree Collapse file tree 3 files changed +6
-8
lines changed Expand file tree Collapse file tree 3 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ const os_has_fork = switch (builtin.os.tag) {
3535};
3636const os_has_arc4random = builtin .link_libc and @hasDecl (std .c , "arc4random_buf" );
3737const want_fork_safety = os_has_fork and ! os_has_arc4random and
38- ( std .meta . globalOption ( " crypto_fork_safety" , bool ) orelse true ) ;
38+ std .options . crypto_fork_safety ;
3939const maybe_have_wipe_on_fork = builtin .os .isAtLeast (.linux , .{
4040 .major = 4 ,
4141 .minor = 14 ,
Original file line number Diff line number Diff line change @@ -1099,13 +1099,6 @@ test "ArgsTuple forwarding" {
10991099 }
11001100}
11011101
1102- /// TODO: https://github.com/ziglang/zig/issues/425
1103- pub fn globalOption (comptime name : []const u8 , comptime T : type ) ? T {
1104- if (! @hasDecl (root , name ))
1105- return null ;
1106- return @as (T , @field (root , name ));
1107- }
1108-
11091102/// Returns whether `error_union` contains an error.
11101103pub fn isError (error_union : anytype ) bool {
11111104 return if (error_union ) | _ | false else | _ | true ;
Original file line number Diff line number Diff line change @@ -264,6 +264,11 @@ pub const options = struct {
264264 else
265265 false ;
266266
267+ pub const crypto_fork_safety : bool = if (@hasDecl (options_override , "crypto_fork_safety" ))
268+ options_override .crypto_fork_safety
269+ else
270+ true ;
271+
267272 /// By default Zig disables SIGPIPE by setting a "no-op" handler for it. Set this option
268273 /// to `true` to prevent that.
269274 ///
You can’t perform that action at this time.
0 commit comments