From 26580bc2fabdb461a678a8c3050bf2195170fb38 Mon Sep 17 00:00:00 2001 From: Otto Rottier Date: Thu, 23 May 2024 16:59:37 +0200 Subject: [PATCH 1/4] Update rust CI macos runners (use 12/intel and 14/M1) --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 0c152ae..1f7fd7f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -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: From a2a69041b8195b9e3e8f2ed48202c921df864b71 Mon Sep 17 00:00:00 2001 From: Otto Date: Thu, 23 May 2024 17:14:49 +0200 Subject: [PATCH 2/4] Fix indentation in docs to make clippy happy --- src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 6006f79..7ad2e50 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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 @@ -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 /// @@ -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 @@ -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 /// @@ -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 /// From ee0b9618aea62d5dbec6aaabd90a0ac2f14578c4 Mon Sep 17 00:00:00 2001 From: Otto Date: Thu, 23 May 2024 17:25:29 +0200 Subject: [PATCH 3/4] Annotate windows transmute types --- src/rt_win.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rt_win.rs b/src/rt_win.rs index 480c5bd..b76a775 100644 --- a/src/rt_win.rs +++ b/src/rt_win.rs @@ -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; @@ -94,12 +95,12 @@ mod avrt_lib { pub(super) fn try_new() -> Result { let module = OwnedLibrary::try_new(w!("avrt.dll"))?; let av_set_mm_thread_characteristics_w = unsafe { - std::mem::transmute::<_, AvSetMmThreadCharacteristicsWFn>( + std::mem::transmute::( module.get_proc(s!("AvSetMmThreadCharacteristicsW"))?, ) }; let av_revert_mm_thread_characteristics = unsafe { - std::mem::transmute::<_, AvRevertMmThreadCharacteristicsFn>( + std::mem::transmute::( module.get_proc(s!("AvRevertMmThreadCharacteristics"))?, ) }; From 05d48596329180c35d4716f649cc9d44f77ce6e2 Mon Sep 17 00:00:00 2001 From: Otto Date: Thu, 23 May 2024 20:37:25 +0200 Subject: [PATCH 4/4] Do not run CI tests on macos platform --- .github/workflows/rust.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 1f7fd7f..37b16f6 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -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'