From 0d5f4c56f2cdf448b5cf2ec389fb3d4f009dfd4c Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Mon, 25 Feb 2019 16:44:53 +0000 Subject: [PATCH] Remove usage of ATOMIC_BOOL_INIT We currently don't support old enough compilers to require this. --- src/linux_android.rs | 6 +++--- src/netbsd.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/linux_android.rs b/src/linux_android.rs index f9c3300..4bad074 100644 --- a/src/linux_android.rs +++ b/src/linux_android.rs @@ -15,9 +15,9 @@ use std::fs::File; use std::io; use std::io::Read; use std::cell::RefCell; -use std::sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT, Ordering}; +use std::sync::atomic::{AtomicBool, Ordering}; -static RNG_INIT: AtomicBool = ATOMIC_BOOL_INIT; +static RNG_INIT: AtomicBool = AtomicBool::new(false); enum RngSource { GetRandom, @@ -67,7 +67,7 @@ fn is_getrandom_available() -> bool { use std::sync::{Once, ONCE_INIT}; static CHECKER: Once = ONCE_INIT; - static AVAILABLE: AtomicBool = ATOMIC_BOOL_INIT; + static AVAILABLE: AtomicBool = AtomicBool::new(false); CHECKER.call_once(|| { let mut buf: [u8; 0] = []; diff --git a/src/netbsd.rs b/src/netbsd.rs index 6a59509..089272a 100644 --- a/src/netbsd.rs +++ b/src/netbsd.rs @@ -13,9 +13,9 @@ use super::utils::use_init; use std::fs::File; use std::io::Read; use std::cell::RefCell; -use std::sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT, Ordering}; +use std::sync::atomic::{AtomicBool, Ordering}; -static RNG_INIT: AtomicBool = ATOMIC_BOOL_INIT; +static RNG_INIT: AtomicBool = AtomicBool::new(false); thread_local!(static RNG_FILE: RefCell> = RefCell::new(None));