diff --git a/src/rust/include/librustzcash.h b/src/rust/include/librustzcash.h index 239093dc3..f69ae6c6d 100644 --- a/src/rust/include/librustzcash.h +++ b/src/rust/include/librustzcash.h @@ -3,7 +3,13 @@ #include -const int ENTRY_SERIALIZED_LENGTH = 180; +#ifndef __cplusplus + #include + #include +#endif + +#define ENTRY_SERIALIZED_LENGTH 180 + typedef struct HistoryEntry { unsigned char bytes[ENTRY_SERIALIZED_LENGTH]; } HistoryEntry; @@ -12,7 +18,9 @@ static_assert( "HistoryEntry struct is not the same size as the underlying byte array"); static_assert(alignof(HistoryEntry) == 1, "HistoryEntry struct alignment is not 1"); +#ifdef __cplusplus extern "C" { +#endif #ifdef WIN32 typedef uint16_t codeunit; #else @@ -343,6 +351,8 @@ extern "C" { const unsigned char *n_ptr, unsigned char *h_ret ); +#ifdef __cplusplus } +#endif #endif // LIBRUSTZCASH_INCLUDE_H_