librustzcash: make the header C compatible

This commit is contained in:
Danny Willems 2020-05-15 17:49:32 +02:00 committed by Danny Willems
parent 2d77cd241a
commit 80fe96a04e
No known key found for this signature in database
GPG Key ID: 87E9243228C1E125
1 changed files with 9 additions and 0 deletions

View File

@ -3,6 +3,11 @@
#include <stdint.h>
#ifndef __cplusplus
#define static_assert _Static_assert
#include <stdalign.h>
#endif
const int ENTRY_SERIALIZED_LENGTH = 180;
typedef struct HistoryEntry {
unsigned char bytes[ENTRY_SERIALIZED_LENGTH];
@ -12,7 +17,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 +350,8 @@ extern "C" {
const unsigned char *n_ptr,
unsigned char *h_ret
);
#ifdef __cplusplus
}
#endif
#endif // LIBRUSTZCASH_INCLUDE_H_