From 7d6ab52de8b5d0e0afa7b44d3930a20073e4be36 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 28 Jul 2021 00:45:46 +0000 Subject: [PATCH] Swap include <> for include "" to make downstream Swift projects happy --- genbindings.sh | 4 ++-- ldk-net/ldk_net.h | 2 +- lightning-c-bindings/cbindgen.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/genbindings.sh b/genbindings.sh index 9aec12d..7afc274 100755 --- a/genbindings.sh +++ b/genbindings.sh @@ -198,13 +198,13 @@ if [ "$HOST_PLATFORM" = "host: x86_64-apple-darwin" ]; then # 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 /g' include/lightning.h + sed -i '' 's/#include /#include "ldk_rust_types.h"/g' include/lightning.h else sed -i 's/typedef LDKnative.*Import.*LDKnative.*;//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 /g' include/lightning.h + sed -i 's/#include /#include "ldk_rust_types.h"/g' include/lightning.h fi # Finally, sanity-check the generated C and C++ bindings with demo apps: diff --git a/ldk-net/ldk_net.h b/ldk-net/ldk_net.h index 258b5ba..f8b3edb 100644 --- a/ldk-net/ldk_net.h +++ b/ldk-net/ldk_net.h @@ -1,4 +1,4 @@ -#include +#include "lightning.h" #include /** * Initializes socket handling and spawns a background thread to handle socket diff --git a/lightning-c-bindings/cbindgen.toml b/lightning-c-bindings/cbindgen.toml index bcbe264..ec6c74d 100644 --- a/lightning-c-bindings/cbindgen.toml +++ b/lightning-c-bindings/cbindgen.toml @@ -1,7 +1,7 @@ language = "C" include_guard = "LDK_C_BINDINGS_H" autogen_warning = "/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */" -trailer = "#include " +trailer = "#include \"ldk_ver.h\"" include_version = true namespace = "LDK" -- 2.30.2