Attempted fix for Windows/macOS build
This commit is contained in:
parent
cd89d6cec6
commit
a24507ff1e
|
@ -16,6 +16,15 @@ jobs:
|
|||
fail-fast: false
|
||||
runs-on: ${{ matrix.platform }}
|
||||
steps:
|
||||
- name: Install LLVM and Clang # required for bindgen to work, see https://github.com/rust-lang/rust-bindgen/issues/1797
|
||||
uses: KyleMayes/install-llvm-action@v1
|
||||
if: matrix.config.platform == 'windows-latest'
|
||||
with:
|
||||
version: 12.0.1
|
||||
directory: ${{ runner.temp }}/llvm
|
||||
- name: Set LIBCLANG_PATH
|
||||
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
|
||||
if: matrix.config.platform == 'windows-latest'
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
|
|
1
build.rs
1
build.rs
|
@ -18,6 +18,7 @@ fn main() {
|
|||
.size_t_is_usize(true)
|
||||
.ctypes_prefix("types")
|
||||
.derive_debug(false)
|
||||
.clang_arg("-std=c++14")
|
||||
.parse_callbacks(Box::new(bindgen::CargoCallbacks));
|
||||
#[cfg(not(feature = "std"))]
|
||||
{
|
||||
|
|
|
@ -54,11 +54,7 @@
|
|||
extern crate alloc;
|
||||
|
||||
#[cfg(all(not(feature = "std"), feature = "alloc"))]
|
||||
use alloc::{
|
||||
alloc::{alloc_zeroed, dealloc, Layout},
|
||||
boxed::Box,
|
||||
vec::Vec,
|
||||
};
|
||||
use alloc::{boxed::Box, vec::Vec};
|
||||
#[cfg(feature = "alloc")]
|
||||
use core::ptr::null_mut;
|
||||
use core::{marker::PhantomData, mem::size_of};
|
||||
|
|
|
@ -113,12 +113,13 @@ mod tests {
|
|||
|
||||
use super::{compress::compress, decompress::decompress};
|
||||
|
||||
const INPUT: &[u8] = include_bytes!("test1.txt");
|
||||
|
||||
#[test]
|
||||
fn test_round_trip() {
|
||||
let src = include_bytes!("test1.txt");
|
||||
let compressed = compress(src).expect("Failed to compress");
|
||||
let mut dst = vec![0u8; src.len()];
|
||||
let compressed = compress(INPUT).expect("Failed to compress");
|
||||
let mut dst = vec![0u8; INPUT.len()];
|
||||
decompress(&compressed, &mut dst).expect("Failed to decompress");
|
||||
assert_eq!(&src[..], dst.as_slice());
|
||||
assert_eq!(INPUT, dst.as_slice());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue