Skip to content

Commit 94c41d8

Browse files
authored
Merge pull request #1226 from TheBlueMatt/2022-01-bindings-no-std
Support building `cfg=c_bindings` with `no-std`
2 parents 3ca6342 + ffbef9f commit 94c41d8

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,14 @@ jobs:
109109
run: RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always
110110
- name: Test on no-std bullds Rust ${{ matrix.toolchain }}
111111
if: "matrix.build-no-std && !matrix.coverage"
112+
shell: bash # Default on Winblows is powershell
112113
run: |
113114
cd lightning
114115
cargo test --verbose --color always --no-default-features --features no-std
115116
# check if there is a conflict between no-std and the default std feature
116117
cargo test --verbose --color always --features no-std
118+
# check if there is a conflict between no-std and the c_bindings cfg
119+
RUSTFLAGS="--cfg=c_bindings" cargo test --verbose --color always --no-default-features --features=no-std
117120
cd ..
118121
- name: Test on no-std builds Rust ${{ matrix.toolchain }} and full code-linking for coverage generation
119122
if: "matrix.build-no-std && matrix.coverage"

lightning/src/util/logger.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
use core::cmp;
1818
use core::fmt;
1919

20+
#[cfg(c_bindings)]
21+
use prelude::*; // Needed for String
22+
2023
static LOG_LEVEL_NAMES: [&'static str; 6] = ["GOSSIP", "TRACE", "DEBUG", "INFO", "WARN", "ERROR"];
2124

2225
/// An enum representing the available verbosity levels of the logger.

0 commit comments

Comments
 (0)