X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-c-bindings;a=blobdiff_plain;f=genbindings.sh;fp=genbindings.sh;h=c5025982dc36a15704da88bbd69580ee1bcc2d49;hp=1d53b96ca1804077661b7603e9974c1f75615350;hb=cd94859a3ef20447674f393d3f169bd9e29023a1;hpb=316ba2b5b764a1595f0993bc457714efdaf424ad diff --git a/genbindings.sh b/genbindings.sh index 1d53b96..c502598 100755 --- a/genbindings.sh +++ b/genbindings.sh @@ -231,6 +231,9 @@ cbindgen -v --config cbindgen.toml -o include/lightning.h >/dev/null 2>&1 if is_gnu_sed; then sed -i 's/typedef LDKnative.*Import.*LDKnative.*;//g' include/lightning.h + # UnsafeCell is `repr(transparent)` so should be ignored here + sed -i 's/LDKUnsafeCell<\(.*\)> /\1 /g' include/lightning.h + # stdlib.h doesn't exist in clang's wasm sysroot, and cbindgen # doesn't actually use it anyway, so drop the import. sed -i 's/#include /#include "ldk_rust_types.h"/g' include/lightning.h @@ -238,6 +241,9 @@ else # OSX sed is for some reason not compatible with GNU sed sed -i '' 's/typedef LDKnative.*Import.*LDKnative.*;//g' include/lightning.h + # UnsafeCell is `repr(transparent)` so should be ignored by cbindgen + sed -i '' 's/LDKUnsafeCell<\(.*\)> /\1 /g' include/lightning.h + # stdlib.h doesn't exist in clang's wasm sysroot, and cbindgen # doesn't actually use it anyway, so drop the import. sed -i '' 's/#include /#include "ldk_rust_types.h"/g' include/lightning.h