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

Add support for macOS #39

Merged
merged 1 commit into from
Nov 12, 2024
Merged

Add support for macOS #39

merged 1 commit into from
Nov 12, 2024

Conversation

bjorn3
Copy link
Collaborator

@bjorn3 bjorn3 commented Nov 12, 2024

No description provided.

@bjorn3 bjorn3 force-pushed the macos_support branch 2 times, most recently from 812eb8c to 3bfbd5f Compare November 12, 2024 14:24
Copy link

codecov bot commented Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
bzip2.rs 82.68% <100.00%> (ø)
bzip2recover.rs 97.84% <100.00%> (+<0.01%) ⬆️
bzlib.rs 87.84% <ø> (ø)

@bjorn3 bjorn3 marked this pull request as draft November 12, 2024 14:26
@bjorn3 bjorn3 force-pushed the macos_support branch 6 times, most recently from b5ca3d4 to cd51d74 Compare November 12, 2024 14:48
@bjorn3 bjorn3 marked this pull request as ready for review November 12, 2024 14:52
@bjorn3 bjorn3 requested a review from folkertdev November 12, 2024 14:52
Copy link
Collaborator

@folkertdev folkertdev left a comment

Choose a reason for hiding this comment

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

looks good, needs a (trivial?) rebase though

Comment on lines +13 to 19
// FIXME remove this
extern "C" {
static stdin: *mut FILE;
static stdout: *mut FILE;
#[cfg_attr(target_os = "macos", link_name = "__stdinp")]
static mut stdin: *mut FILE;
#[cfg_attr(target_os = "macos", link_name = "__stdoutp")]
static mut stdout: *mut FILE;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah these are also a problem on windows, leading me to suspect that this binary was not actually cross-platform . Invalid windows paths are handled, but this would not even build on windows...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In C stdin and stdout are macros which expand to a libc specific expression. Unfortunately the libc crate doesn't provide the definitions of these macros, so we have to manually write their expansion instead.

@bjorn3 bjorn3 merged commit 82443b8 into main Nov 12, 2024
13 checks passed
@bjorn3 bjorn3 deleted the macos_support branch November 12, 2024 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants