From: Matt Corallo Date: Sun, 30 Jul 2023 03:36:56 +0000 (+0000) Subject: Include a `struct` before trait return fields X-Git-Tag: v0.0.116.0^2~4 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=5ed40760d7e99198848633f5ea3dbb60871591e7;p=ldk-c-bindings Include a `struct` before trait return fields EIther `struct Type` or `Type` work fine because of our type declarations, but cbindgen uses `struct Type` everywhere so its easiest if we match it, especially for downstream code. --- diff --git a/genbindings.sh b/genbindings.sh index c502598..f105816 100755 --- a/genbindings.sh +++ b/genbindings.sh @@ -232,7 +232,7 @@ 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 + sed -i 's/LDKUnsafeCell<\(.*\)> /struct \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. @@ -242,7 +242,7 @@ else 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 + sed -i '' 's/LDKUnsafeCell<\(.*\)> /struct \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.