Skip to content

Commit

Permalink
Merge pull request #21 from aodinokov/ffi_part2
Browse files Browse the repository at this point in the history
Second part of libffi related work
  • Loading branch information
aodinokov authored Aug 18, 2024
2 parents 4d73489 + 1dd136d commit a4663da
Show file tree
Hide file tree
Showing 8 changed files with 694 additions and 165 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/buildAndTest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ jobs:

# Not required, but speeds up builds by storing container images in
# a GitHub package registry.
githubToken: ${{ github.token }}
# githubToken: ${{ github.token }}

# Set an output parameter `uname` for use in subsequent steps
run: |
set -x
uname -a
apt update && apt-get install -y ca-certificates pkg-config make gcc g++ check # todo: libffi-dev
apt update && apt-get install -y ca-certificates pkg-config make gcc g++ check libffi-dev
tar -C /usr/local -xzf go.tar.gz && rm go.tar.gz
export PATH=$PATH:/usr/local/go/bin
Expand Down
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"name": "(lldb) Launch - Macos",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/value_with_args_test",
"program": "${fileDirname}/value_ffi_test",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
Expand Down
4 changes: 2 additions & 2 deletions examples/c_ffi_call/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ int main() {
free(s);
}

metac_value_t *p_res_val = metac_new_value_with_call_result(p_params_val);
if (metac_value_call(p_params_val, (void (*)(void))test_function1_with_args, p_res_val) == 0) {
metac_value_t *p_res_val = metac_new_value_with_call_result(metac_value_entry(p_params_val));
if (metac_value_ffi_call(p_params_val, (void (*)(void))test_function1_with_args, p_res_val) == 0) {
char * ret = NULL;
if (p_res_val != NULL) {
ret = metac_value_string_ex(p_res_val, METAC_WMODE_deep, NULL);
Expand Down
Loading

0 comments on commit a4663da

Please sign in to comment.