about summary refs log tree commit diff
path: root/src/libstd/rand
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2016-01-30 13:27:00 -0800
committerAlex Crichton <alex@alexcrichton.com>2016-02-01 20:39:07 -0800
commit8f803c202681fa137fca691df999ac3f335d29c1 (patch)
treefab48b98c0d3460bb113a883e5c159be4b88454c /src/libstd/rand
parent449e8bf3048d144fd5b82dd1a1a1060ff86b2877 (diff)
Remove "powerpc64le" and "mipsel" target_arch
Currently the `mipsel-unknown-linux-gnu` target doesn't actually set the
`target_arch` value to `mipsel` but it rather uses `mips`. Alternatively the
`powerpc64le` target does indeed set the `target_arch` as `powerpc64le`,
causing a bit of inconsistency between theset two.

As these are just the same instance of one instruction set, let's use
`target_endian` to switch between them and only set the `target_arch` as one
value. This should cut down on the number of `#[cfg]` annotations necessary and
all around be a little more ergonomic.
Diffstat (limited to 'src/libstd/rand')
-rw-r--r--src/libstd/rand/os.rs15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/libstd/rand/os.rs b/src/libstd/rand/os.rs
index 619f100f1a1..8d92909faf5 100644
--- a/src/libstd/rand/os.rs
+++ b/src/libstd/rand/os.rs
@@ -31,8 +31,7 @@ mod imp {
                   target_arch = "arm",
                   target_arch = "aarch64",
                   target_arch = "powerpc",
-                  target_arch = "powerpc64",
-                  target_arch = "powerpc64le")))]
+                  target_arch = "powerpc64")))]
     fn getrandom(buf: &mut [u8]) -> libc::c_long {
         #[cfg(target_arch = "x86_64")]
         const NR_GETRANDOM: libc::c_long = 318;
@@ -40,8 +39,7 @@ mod imp {
         const NR_GETRANDOM: libc::c_long = 355;
         #[cfg(target_arch = "arm")]
         const NR_GETRANDOM: libc::c_long = 384;
-        #[cfg(any(target_arch = "powerpc", target_arch = "powerpc64",
-                  target_arch = "powerpc64le"))]
+        #[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))]
         const NR_GETRANDOM: libc::c_long = 359;
         #[cfg(target_arch = "aarch64")]
         const NR_GETRANDOM: libc::c_long = 278;
@@ -57,8 +55,7 @@ mod imp {
                       target_arch = "arm",
                       target_arch = "aarch64",
                       target_arch = "powerpc",
-                      target_arch = "powerpc64",
-                      target_arch = "powerpc64le"))))]
+                      target_arch = "powerpc64"))))]
     fn getrandom(_buf: &mut [u8]) -> libc::c_long { -1 }
 
     fn getrandom_fill_bytes(v: &mut [u8]) {
@@ -96,8 +93,7 @@ mod imp {
                   target_arch = "arm",
                   target_arch = "aarch64",
                   target_arch = "powerpc",
-                  target_arch = "powerpc64",
-                  target_arch = "powerpc64le")))]
+                  target_arch = "powerpc64")))]
     fn is_getrandom_available() -> bool {
         use sync::atomic::{AtomicBool, Ordering};
         use sync::Once;
@@ -126,8 +122,7 @@ mod imp {
                       target_arch = "arm",
                       target_arch = "aarch64",
                       target_arch = "powerpc",
-                      target_arch = "powerpc64",
-                      target_arch = "powerpc64le"))))]
+                      target_arch = "powerpc64"))))]
     fn is_getrandom_available() -> bool { false }
 
     /// A random number generator that retrieves randomness straight from