Skip to content

Commit

Permalink
fix(netbsd): use libstd++ on netbsd as libc++ is not available
Browse files Browse the repository at this point in the history
Fixes #65
  • Loading branch information
0-wiz-0 authored Feb 19, 2025
1 parent 85e2ed8 commit 8d29b6e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/pathed/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#[cfg_attr(target_os = "linux", path = "linux.rs")]
#[cfg_attr(not(target_os = "linux"), path = "all.rs")]
#[cfg_attr(any(target_os = "linux", target_os = "netbsd"), path = "linux.rs")]
#[cfg_attr(not(any(target_os = "linux", target_os = "netbsd")), path = "all.rs")]
mod os;

pub(crate) use os::*;
pub(crate) use os::*;
8 changes: 4 additions & 4 deletions unrar_sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ pub struct OpenArchiveDataEx {
#[link(name = "unrar", kind = "static")]
#[cfg_attr(all(windows, target_env = "gnu"), link(name = "stdc++", kind = "static", modifiers = "-bundle"))]
#[cfg_attr(target_os = "macos", link(name = "c++"))]
#[cfg_attr(any(target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"), link(name = "c++"))]
#[cfg_attr(target_os = "linux", link(name = "stdc++"))]
#[cfg_attr(any(target_os = "freebsd", target_os = "openbsd"), link(name = "c++"))]
#[cfg_attr(any(target_os = "linux", target_os = "netbsd"), link(name = "stdc++"))]
extern "C" {
pub fn RAROpenArchive(data: *const OpenArchiveData) -> *const Handle;

Expand Down Expand Up @@ -334,12 +334,12 @@ impl OpenArchiveData {
}

impl OpenArchiveDataEx {
#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "netbsd"))]
pub fn new(archive: *const c_char, mode: c_uint) -> Self {
Self::new_internal(archive, std::ptr::null(), mode)
}

#[cfg(not(target_os = "linux"))]
#[cfg(not(any(target_os = "linux", target_os = "netbsd")))]
pub fn new(archive: *const wchar_t, mode: c_uint) -> Self {
Self::new_internal(std::ptr::null(), archive, mode)
}
Expand Down

0 comments on commit 8d29b6e

Please sign in to comment.