FFI: Extract common codeunit types into a rust/types.h header

This commit is contained in:
Jack Grigg 2020-08-05 23:13:18 +01:00
parent 253ea6db38
commit cb294bbda0
3 changed files with 20 additions and 10 deletions

View File

@ -1,6 +1,8 @@
#ifndef LIBRUSTZCASH_INCLUDE_H_
#define LIBRUSTZCASH_INCLUDE_H_
#include "rust/types.h"
#include <stdint.h>
#ifndef __cplusplus
@ -29,11 +31,6 @@ static_assert(alignof(HistoryEntry) == 1, "HistoryEntry struct alignment is not
#ifdef __cplusplus
extern "C" {
#endif
#ifdef WIN32
typedef uint16_t codeunit;
#else
typedef uint8_t codeunit;
#endif
void librustzcash_to_scalar(const unsigned char *input, unsigned char *result);

View File

@ -0,0 +1,16 @@
// Copyright (c) 2020 The Zcash developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or https://www.opensource.org/licenses/mit-license.php .
#ifndef RUST_TYPES_H_
#define RUST_TYPES_H_
#include <stdint.h>
#ifdef WIN32
typedef uint16_t codeunit;
#else
typedef uint8_t codeunit;
#endif
#endif // RUST_TYPES_H_

View File

@ -5,6 +5,8 @@
#ifndef TRACING_INCLUDE_H_
#define TRACING_INCLUDE_H_
#include "rust/types.h"
#include <stdint.h>
#ifdef __cplusplus
@ -12,11 +14,6 @@
extern "C" {
#endif
#ifdef WIN32
typedef uint16_t codeunit;
#else
typedef uint8_t codeunit;
#endif
struct TracingHandle;
typedef struct TracingHandle TracingHandle;