Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows builds #37

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion crates/dvdbnd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use aes::{
Aes128,
};
use fstools_formats::bhd::Bhd;
use memmap2::{Advice, MmapOptions};
use memmap2::MmapOptions;
use thiserror::Error;

pub use self::{
Expand All @@ -14,6 +14,9 @@ pub use self::{
reader::DvdBndEntryReader,
};

#[cfg(not(target_family = "windows"))]
use memmap2::Advice;

mod key_provider;
mod name;
mod reader;
Expand Down Expand Up @@ -140,6 +143,7 @@ impl DvdBnd {
data_cipher.decrypt_blocks(blocks);
}

#[cfg(not(target_family = "windows"))]
Copy link
Collaborator

@garyttierney garyttierney Apr 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#[cfg(not(target_family = "windows"))]
#[cfg(target_family = "unix")]

Copy link
Member Author

@vswarte vswarte Apr 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh I don't think that's correct?
Although its probably better to do #[cfg(target_family = "unix")] as it doesn't seem to be supported at all outside of unix

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh I don't think that's correct?

Based on what? https://github.com/RazrFalcon/memmap2-rs/blob/master/src/lib.rs#L47-L48

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think I was staring at a cached version of your suggestion

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

febdc33 should do the trick

let _ = mmap.advise(Advice::Sequential);

Ok(DvdBndEntryReader::new(mmap.make_read_only()?))
Expand Down
5 changes: 4 additions & 1 deletion crates/viewer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ fstools_formats.workspace = true
fstools_dvdbnd.workspace = true
thiserror.workspace = true

# https://github.com/bevyengine/bevy/issues/10425
blake3 = { version = "1.5", features = ["pure"] }

[lints]
workspace = true
workspace = true