Skip to content

Commit

Permalink
Merge pull request #114 from mkfyi/main
Browse files Browse the repository at this point in the history
Add missing inline specifier in C header
  • Loading branch information
ko1N committed Apr 4, 2024
2 parents 83e8fff + dd88aea commit 9ce52de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions memflow-ffi/bindgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ cargo +nightly install cglue-bindgen
# generate c and cpp bindings
run_twice rustup run nightly cglue-bindgen +nightly -c cglue.toml -- --config cbindgen.toml --crate memflow-ffi --output memflow.h -l C
run_twice rustup run nightly cglue-bindgen +nightly -c cglue.toml -- --config cbindgen.toml --crate memflow-ffi --output memflow.hpp -l C++

# temporary workaround
sed -i 's/void ctx_arc_drop/static inline void ctx_arc_drop/i' memflow.h
sed -i 's/void cont_box_drop/static inline void cont_box_drop/i' memflow.h
4 changes: 2 additions & 2 deletions memflow-ffi/memflow.h
Original file line number Diff line number Diff line change
Expand Up @@ -2654,10 +2654,10 @@ static CArc_c_void ctx_arc_clone(CArc_c_void *self) {
return ret;
}

void ctx_arc_drop(CArc_c_void *self) {
static inline void ctx_arc_drop(CArc_c_void *self) {
if (self->drop_fn && self->instance) self->drop_fn(self->instance);
}
void cont_box_drop(CBox_c_void *self) {
static inline void cont_box_drop(CBox_c_void *self) {
if (self->drop_fn && self->instance) self->drop_fn(self->instance);
}

Expand Down

0 comments on commit 9ce52de

Please sign in to comment.