Skip to content

Commit 0d5f4c5

Browse files
committed
Remove usage of ATOMIC_BOOL_INIT
We currently don't support old enough compilers to require this.
1 parent a40d3de commit 0d5f4c5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/linux_android.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ use std::fs::File;
1515
use std::io;
1616
use std::io::Read;
1717
use std::cell::RefCell;
18-
use std::sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT, Ordering};
18+
use std::sync::atomic::{AtomicBool, Ordering};
1919

20-
static RNG_INIT: AtomicBool = ATOMIC_BOOL_INIT;
20+
static RNG_INIT: AtomicBool = AtomicBool::new(false);
2121

2222
enum RngSource {
2323
GetRandom,
@@ -67,7 +67,7 @@ fn is_getrandom_available() -> bool {
6767
use std::sync::{Once, ONCE_INIT};
6868

6969
static CHECKER: Once = ONCE_INIT;
70-
static AVAILABLE: AtomicBool = ATOMIC_BOOL_INIT;
70+
static AVAILABLE: AtomicBool = AtomicBool::new(false);
7171

7272
CHECKER.call_once(|| {
7373
let mut buf: [u8; 0] = [];

src/netbsd.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ use super::utils::use_init;
1313
use std::fs::File;
1414
use std::io::Read;
1515
use std::cell::RefCell;
16-
use std::sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT, Ordering};
16+
use std::sync::atomic::{AtomicBool, Ordering};
1717

18-
static RNG_INIT: AtomicBool = ATOMIC_BOOL_INIT;
18+
static RNG_INIT: AtomicBool = AtomicBool::new(false);
1919

2020
thread_local!(static RNG_FILE: RefCell<Option<File>> = RefCell::new(None));
2121

0 commit comments

Comments
 (0)