]> git.lizzy.rs Git - rust.git/commitdiff
disentangle macos and linux dlsyms
authorRalf Jung <post@ralfj.de>
Thu, 21 May 2020 21:00:59 +0000 (23:00 +0200)
committerRalf Jung <post@ralfj.de>
Thu, 21 May 2020 21:01:27 +0000 (23:01 +0200)
src/shims/dlsym.rs

index 1416db346cd03fafdb61c2cd3b90c58c8957b9d6..301687092813bf691290320622e9694e797ee18f 100644 (file)
@@ -15,15 +15,18 @@ pub fn from_str(name: &[u8], target_os: &str) -> InterpResult<'static, Option<Dl
         use self::Dlsym::*;
         let name = String::from_utf8_lossy(name);
         Ok(match target_os {
-            "linux" | "macos" => match &*name {
-                "getentropy" => Some(GetEntropy),
+            "linux" => match &*name {
                 "__pthread_get_minstack" => None,
-                _ => throw_unsup_format!("unsupported dlsym: {}", name),
+                _ => throw_unsup_format!("unsupported Linux dlsym: {}", name),
+            }
+            "macos" => match &*name {
+                "getentropy" => Some(GetEntropy),
+                _ => throw_unsup_format!("unsupported macOS dlsym: {}", name),
             }
             "windows" => match &*name {
                 "SetThreadStackGuarantee" => None,
                 "AcquireSRWLockExclusive" => None,
-                _ => throw_unsup_format!("unsupported dlsym: {}", name),
+                _ => throw_unsup_format!("unsupported Windows dlsym: {}", name),
             }
             os => bug!("dlsym not implemented for target_os {}", os),
         })