Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ jobs:
os: windows-2022
features: ""
target: "x86_64-pc-windows-gnu"
- rust: stable-x86_64-msvc
os: windows-2022
features: ""
target: "x86_64-pc-windows-msvc"
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
Expand Down
6 changes: 3 additions & 3 deletions bzip2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ extern "C" {
static mut stdout_handle: *mut FILE;
}

#[cfg(all(target_os = "windows", target_env = "gnu"))]
#[cfg(target_os = "windows")]
extern "C" {
fn __acrt_iob_func(idx: libc::c_uint) -> *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.

Is this also the correct implementation when using the ucrt.dll and not just msvcrt.dll?

Copy link
Member

Choose a reason for hiding this comment

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

I don't know but now it'll at least build. We don't currently really intend to support the binaries anyway, and for windows the high-level interface is also just nice if it works (bzip2 only uses the low-level interface, where we do really care that it works on windows of course).

Is there a simple way to test for the scenario you describe in CI (I'm really not familiar with msvc)

Copy link
Collaborator

Choose a reason for hiding this comment

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

The x86_64-pc-windows-gnullvm target uses the ucrt.

}
Expand All @@ -43,7 +43,7 @@ macro_rules! STDIN {
};
}

#[cfg(all(target_os = "windows", target_env = "gnu"))]
#[cfg(target_os = "windows")]
macro_rules! STDIN {
() => {
__acrt_iob_func(0)
Expand All @@ -57,7 +57,7 @@ macro_rules! STDOUT {
};
}

#[cfg(all(target_os = "windows", target_env = "gnu"))]
#[cfg(target_os = "windows")]
macro_rules! STDOUT {
() => {
__acrt_iob_func(1)
Expand Down
6 changes: 3 additions & 3 deletions libbz2-rs-sys/src/high_level.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extern "C" {
static mut stdout: *mut FILE;
}

#[cfg(all(target_os = "windows", target_env = "gnu"))]
#[cfg(target_os = "windows")]
extern "C" {
fn __acrt_iob_func(idx: libc::c_uint) -> *mut FILE;
}
Expand All @@ -45,7 +45,7 @@ macro_rules! STDIN {
};
}

#[cfg(all(target_os = "windows", target_env = "gnu"))]
#[cfg(target_os = "windows")]
macro_rules! STDIN {
() => {
__acrt_iob_func(0)
Expand All @@ -59,7 +59,7 @@ macro_rules! STDOUT {
};
}

#[cfg(all(target_os = "windows", target_env = "gnu"))]
#[cfg(target_os = "windows")]
macro_rules! STDOUT {
() => {
__acrt_iob_func(1)
Expand Down
Loading