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

Update rust CI macos runners (use 12/intel and 14/M1) #29

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
7 changes: 5 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
rust: [stable, nightly]
os: [ubuntu-20.04, windows-2019, macos-10.15]
os: [ubuntu-20.04, windows-2019, macos-12, macos-14]
type: [Release, Debug]

steps:
Expand Down Expand Up @@ -36,4 +36,7 @@ jobs:
- name: Test
shell: bash
run: rustup run ${{ matrix.rust }} cargo test --all
if: matrix.os != 'ubuntu-20.04' # setrlimit64 error in the CI container
# ubuntu setrlimit64 error in the CI container, macos not supported
if: >
matrix.os != 'ubuntu-20.04'
&& matrix.os != 'macos-12' && matrix.os != 'macos-14'
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ pub extern "C" fn atp_set_real_time_limit(audio_buffer_frames: u32,
/// # Arguments
///
/// * `audio_buffer_frames` - the exact or an upper limit on the number of frames that have to be
/// rendered each callback, or 0 for a sensible default value.
/// rendered each callback, or 0 for a sensible default value.
/// * `audio_samplerate_hz` - the sample-rate for this audio stream, in Hz.
///
/// # Return value
Expand All @@ -476,7 +476,7 @@ pub fn promote_current_thread_to_real_time(
/// # Arguments
///
/// * `handle` - An opaque struct returned from a successful call to
/// `promote_current_thread_to_real_time`.
/// `promote_current_thread_to_real_time`.
///
/// # Return value
///
Expand All @@ -496,7 +496,7 @@ pub struct atp_handle(RtPriorityHandle);
/// # Arguments
///
/// * `audio_buffer_frames` - the exact or an upper limit on the number of frames that have to be
/// rendered each callback, or 0 for a sensible default value.
/// rendered each callback, or 0 for a sensible default value.
/// * `audio_samplerate_hz` - the sample-rate for this audio stream, in Hz.
///
/// # Return value
Expand Down Expand Up @@ -524,7 +524,7 @@ pub extern "C" fn atp_promote_current_thread_to_real_time(
/// # Arguments
///
/// * `atp_handle` - An opaque struct returned from a successful call to
/// `atp_promote_current_thread_to_real_time`.
/// `atp_promote_current_thread_to_real_time`.
///
/// # Return value
///
Expand Down Expand Up @@ -554,7 +554,7 @@ pub unsafe extern "C" fn atp_demote_current_thread_from_real_time(handle: *mut a
/// # Arguments
///
/// * `atp_handle` - An opaque struct returned from a successful call to
/// `atp_promote_current_thread_to_real_time`.
/// `atp_promote_current_thread_to_real_time`.
///
/// # Return value
///
Expand Down
5 changes: 3 additions & 2 deletions src/rt_win.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ mod avrt_lib {
Win32::Foundation::{BOOL, FALSE, HANDLE, WIN32_ERROR},
};

type WFn = unsafe extern "system" fn() -> HANDLE;
type AvSetMmThreadCharacteristicsWFn = unsafe extern "system" fn(PCWSTR, *mut u32) -> HANDLE;
type AvRevertMmThreadCharacteristicsFn = unsafe extern "system" fn(HANDLE) -> BOOL;

Expand All @@ -94,12 +95,12 @@ mod avrt_lib {
pub(super) fn try_new() -> Result<Self, WIN32_ERROR> {
let module = OwnedLibrary::try_new(w!("avrt.dll"))?;
let av_set_mm_thread_characteristics_w = unsafe {
std::mem::transmute::<_, AvSetMmThreadCharacteristicsWFn>(
std::mem::transmute::<WFn, AvSetMmThreadCharacteristicsWFn>(
module.get_proc(s!("AvSetMmThreadCharacteristicsW"))?,
)
};
let av_revert_mm_thread_characteristics = unsafe {
std::mem::transmute::<_, AvRevertMmThreadCharacteristicsFn>(
std::mem::transmute::<WFn, AvRevertMmThreadCharacteristicsFn>(
module.get_proc(s!("AvRevertMmThreadCharacteristics"))?,
)
};
Expand Down