Skip to content

Commit

Permalink
Merge pull request #535 from chewing/issue534
Browse files Browse the repository at this point in the history
Fix FTBFS on aarch64
  • Loading branch information
kanru authored May 15, 2024
2 parents 8f7c805 + 394477f commit c96fee4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-latest, macos-14]
preset:
- rust-release
- rust-with-sqlite-release
Expand All @@ -30,7 +30,7 @@ jobs:

- if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt-get install ninja-build
- if: ${{ matrix.os == 'macos-latest' }}
- if: ${{ matrix.os == 'macos-latest' || matrix.os == 'macos-14' }}
run: brew install ninja
- if: ${{ matrix.os == 'windows-latest' }}
run: choco install ninja
Expand Down
6 changes: 6 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
What's New in libchewing 0.8.1 (May 15, 2024)
---------------------------------------------------------

* Buf fixed
- Fail to build on aarch64 due to type mismatch. (introduced in v0.8.0)

What's New in libchewing 0.8.0 (May 14, 2024)
---------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion capi/src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ unsafe fn slice_from_ptr_with_nul<'a>(ptr: *const c_char) -> Option<&'a [c_char]

unsafe fn str_from_ptr_with_nul<'a>(ptr: *const c_char) -> Option<&'a str> {
unsafe { slice_from_ptr_with_nul(ptr) }
.and_then(|data| str::from_utf8(unsafe { mem::transmute::<&[i8], &[u8]>(data) }).ok())
.and_then(|data| str::from_utf8(unsafe { mem::transmute::<&[c_char], &[u8]>(data) }).ok())
}

#[no_mangle]
Expand Down
2 changes: 1 addition & 1 deletion tests/testhelper/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub unsafe extern "C" fn find_path_by_files(
-1
}

unsafe fn files_ptr_to_slice(files: *const *const i8) -> Vec<Cow<'static, str>> {
unsafe fn files_ptr_to_slice(files: *const *const c_char) -> Vec<Cow<'static, str>> {
let len = {
let mut i = 0;
while unsafe { !files.add(i).read().is_null() } {
Expand Down

0 comments on commit c96fee4

Please sign in to comment.