Skip to content

Commit

Permalink
Refernce build script in Cargo.toml
Browse files Browse the repository at this point in the history
And fix a max_align_t test error
  • Loading branch information
gyscos committed Mar 24, 2017
1 parent e2e7533 commit c63c106
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 31 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ categories = ["compression", "api-bindings"]
license = "MIT"
name = "zstd"
repository = "https://github.com/gyscos/zstd-rs"
version = "0.4.5"
version = "0.4.6"
exclude = ["assets"]

[badges]
travis-ci = { repository = "gyscos/zstd-rs" }

[dependencies]
libc = "0.2"
zstd-sys = { version = "1.1.4", default-features = false }
zstd-sys = { version = "1.1.5-a", default-features = false }

[dev-dependencies]
clap = "2.6.0"
Expand Down
3 changes: 2 additions & 1 deletion zstd-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[package]
authors = ["Alexandre Bury <[email protected]>"]
name = "zstd-sys"
version = "1.1.4"
build = "build.rs"
version = "1.1.5-a"
description = "Low-level bindings for the zstd compression library."
keywords = ["zstd", "zstandard", "compression"]
categories = ["api-bindings", "compression"]
Expand Down
1 change: 1 addition & 0 deletions zstd-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ fn generate_bindings() {
.no_unstable_rust()
.header("zstd.h")
.generate_comments(false) //< remove this when it works
.hide_type("max_align_t")
.ctypes_prefix("::libc")
.clang_arg("-DZSTD_STATIC_LINKING_ONLY")
.generate()
Expand Down
27 changes: 0 additions & 27 deletions zstd-sys/src/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,6 @@ pub const ZSTD_FRAMEHEADERSIZE_MAX: ::libc::c_uint = 18;
pub const ZSTD_FRAMEHEADERSIZE_MIN: ::libc::c_uint = 6;
pub const ZSTD_BLOCKSIZE_ABSOLUTEMAX: ::libc::c_uint = 131072;
pub type wchar_t = ::libc::c_int;
#[repr(C)]
#[derive(Debug, Copy)]
pub struct max_align_t {
pub __clang_max_align_nonce1: ::libc::c_longlong,
pub __bindgen_padding_0: u64,
pub __clang_max_align_nonce2: f64,
}
#[test]
fn bindgen_test_layout_max_align_t() {
assert_eq!(::std::mem::size_of::<max_align_t>() , 32usize , concat ! (
"Size of: " , stringify ! ( max_align_t ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const max_align_t ) ) .
__clang_max_align_nonce1 as * const _ as usize } , 0usize ,
concat ! (
"Alignment of field: " , stringify ! ( max_align_t ) , "::" ,
stringify ! ( __clang_max_align_nonce1 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const max_align_t ) ) .
__clang_max_align_nonce2 as * const _ as usize } , 16usize ,
concat ! (
"Alignment of field: " , stringify ! ( max_align_t ) , "::" ,
stringify ! ( __clang_max_align_nonce2 ) ));
}
impl Clone for max_align_t {
fn clone(&self) -> Self { *self }
}
extern "C" {
pub fn ZSTD_versionNumber() -> ::libc::c_uint;
}
Expand Down
2 changes: 1 addition & 1 deletion zstd-sys/zstd.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/* This file is used to generate bindings for both headers.
* Just run the following command to generate the bindings:
bindgen zstd.h --ctypes-prefix ::libc -- -DZSTD_STATIC_LINKING_ONLY > src/ll.rs
bindgen zstd.h --ctypes-prefix ::libc -- -DZSTD_STATIC_LINKING_ONLY --blacklist-type max_align_t > src/ll.rs
Or use the `bindgen` feature, which will create the bindings automatically.
Expand Down

0 comments on commit c63c106

Please sign in to comment.