Skip to content

Commit a913a47

Browse files
Bump littlefs version
This patch: - Bumps the littlefs version to the latest released (v2.9.3) - Adds a "multiversion" feature flag that exposes the littlefs feature of the same name
1 parent aa64d08 commit a913a47

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ categories = ["embedded", "filesystem", "no-std"]
1010
repository = "https://github.com/nickray/littlefs2-sys"
1111

1212
[build-dependencies]
13-
bindgen = { version = "0.69.4", default-features = false , features = ["runtime"] }
13+
bindgen = { version = "0.70.1", default-features = false , features = ["runtime"] }
1414
cc = "1"
1515

1616
[features]
1717
assertions = []
1818
trace = []
1919
malloc = []
2020
software-intrinsics = []
21+
multiversion = []

build.rs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::path::PathBuf;
44
fn main() -> Result<(), Box<dyn std::error::Error>> {
55
let mut builder = cc::Build::new();
66
let builder = builder
7-
.flag("-std=c11")
7+
.flag("-std=c99")
88
.flag("-DLFS_NO_DEBUG")
99
.flag("-DLFS_NO_WARN")
1010
.flag("-DLFS_NO_ERROR")
@@ -24,17 +24,29 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
2424
#[cfg(not(feature = "malloc"))]
2525
builder.flag("-DLFS_NO_MALLOC");
2626

27+
#[cfg(feature = "multiversion")]
28+
let builder = builder.flag("-DLFS_MULTIVERSION");
29+
2730
builder.compile("lfs-sys");
2831

29-
let bindings = bindgen::Builder::default()
32+
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
33+
34+
let bindgen = bindgen::Builder::default()
3035
.header("littlefs/lfs.h")
36+
.clang_arg("-std=c99")
37+
.clang_arg("-DLFS_NO_DEBUG")
38+
.clang_arg("-DLFS_NO_WARN")
39+
.clang_arg("-DLFS_NO_ERROR");
40+
#[cfg(feature = "multiversion")]
41+
let bindgen = bindgen.clang_arg("-DLFS_MULTIVERSION");
42+
43+
let bindings = bindgen
3144
.use_core()
3245
.allowlist_item("lfs_.*")
3346
.allowlist_item("LFS_.*")
3447
.generate()
3548
.expect("Unable to generate bindings");
3649

37-
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
3850
bindings
3951
.write_to_file(out_path.join("bindings.rs"))
4052
.expect("Couldn't write bindings!");

littlefs

0 commit comments

Comments
 (0)