Multi-file BPF C builds (#2393)
This commit is contained in:
18
programs/bpf/c/src/struct_ret/struct_ret.c
Normal file
18
programs/bpf/c/src/struct_ret/struct_ret.c
Normal file
@@ -0,0 +1,18 @@
|
||||
#include <solana_sdk.h>
|
||||
|
||||
struct foo {const uint8_t *input;};
|
||||
struct foo bar(const uint8_t *input);
|
||||
|
||||
extern bool entrypoint(const uint8_t *input) {
|
||||
struct foo foo = bar(input);
|
||||
sol_log_64(0, 0, 0, (uint64_t)input, (uint64_t)foo.input);
|
||||
sol_assert(input == foo.input);
|
||||
return true;
|
||||
}
|
||||
|
||||
struct foo bar(const uint8_t *input) {
|
||||
struct foo foo;
|
||||
foo.input = input;
|
||||
return foo;
|
||||
}
|
||||
|
Reference in New Issue
Block a user