Skip to content

Commit

Permalink
Added define guard for internal ffi structs which caused redefinition…
Browse files Browse the repository at this point in the history
… errors when including multiple UniFFI c++ libraries in the same project

Signed-off-by: KarolisP <karolis.poviliunas@nordsec.com>
  • Loading branch information
ProphesorIks committed Jul 17, 2024
1 parent 8b30731 commit 582c918
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bindgen/src/bindings/cpp/templates/scaffolding.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
extern "C" {
#endif

#ifndef UNIFFI_CPP_INTERNALSTRUCTS
#define UNIFFI_CPP_INTERNALSTRUCTS
struct ForeignBytes {
int32_t len;
uint8_t *data;
Expand All @@ -22,6 +24,8 @@ struct RustCallStatus {
RustBuffer error_buf;
};

#endif

typedef int ForeignCallback(uint64_t handle, uint32_t method, uint8_t *args_data, int32_t args_len, RustBuffer *buf_ptr);

{% for func in ci.iter_ffi_function_definitions() %}
Expand Down

0 comments on commit 582c918

Please sign in to comment.