Skip to content

Conversation

0e4ef622
Copy link
Contributor

@0e4ef622 0e4ef622 commented Oct 4, 2024

input.rs:

#[repr(C)]
pub struct MyStruct<T> {
    field: T
}

#[no_mangle]
pub extern "C" fn my_function(x: MyStruct<[u8; 4]>) {}

cbindgen --lang c input.rs:

#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

typedef struct MyStruct__________u8__________4 {
  uint8_t field[4];
} MyStruct__________u8__________4;

void my_function(struct MyStruct__________u8__________4 x);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant