Commit Graph

68 Commits

Author SHA1 Message Date
Ivan Enderlin
7c56d893c2 feat(runtime-c-api) Generate the C header file in OUT_DIR.
This patch changes the directory where the C header files are
generated, from `CARGO_MANIFEST_DIR` to `OUT_DIR`. The goal is: When
`wasm-runtime-c-api` is used as a dependency of another Rust project,
then the C header files are accessible in the `target/` directory
(i.e. the `OUT_DIR`).

Also, since `rustc` has a `--out-dir` directory, it increases the
flexibility of this approach: The user can generate the C header files
where she wants.
2019-03-06 10:42:06 +01:00
Syrus Akbary
28bb264266
Merge pull request #232 from Hywan/fix-runtime-c-api-remove-warnings
fix(runtime-c-api) Fix several warnings
2019-03-05 16:38:14 -08:00
Ivan Enderlin
8ed340b6f1 fix(runtime-c-api) Update cbindgen.
When requiring `wasmer-runtime-c-api`, I get the following conflicts:

```
error: failed to select a version for `serde_derive`.
    ... required by package `cbindgen v0.7.1`
    ... which is depended on by `wasmer-runtime-c-api v0.2.1`
    ... which is depended on by `foo v0.1.0 (/private/tmp/foo)`
versions that meet the requirements `= 1.0.58` are: 1.0.58

all possible versions conflict with previously selected packages.

  previously selected package `serde_derive v1.0.89`
    ... which is depended on by `wasmer-runtime-core v0.2.1`
    ... which is depended on by `wasmer-runtime-c-api v0.2.1`
    ... which is depended on by `foo v0.1.0 (/private/tmp/foo)`

failed to select a version for `serde_derive` which could resolve this conflict
```

This issue resolves by updating `cbindgen` to 0.8.
2019-03-05 14:28:35 +01:00
Ivan Enderlin
25feef7384 chore(runtime-c-api) Regenerate the header files. 2019-03-05 10:07:08 +01:00
Ivan Enderlin
86c41264a3 chore(runtime-c-api) Fix CS. 2019-03-05 10:07:08 +01:00
Ivan Enderlin
59de57e075 fix(runtime-c-api) Fix Clippy notes.
This patch fixes warnings raised by Clippy.
2019-03-05 10:07:08 +01:00
Ivan Enderlin
053e5c40f4 fix(runtime-c-api) Avoid mutable bindings as much as possible.
This patch cleans several warnings where mutable bindings are declared
but used only as immutable bindings.

It's a little bit opinionated patch. I think it's interesting to use
`const` pointers as much as possible.
2019-03-05 10:07:08 +01:00
Ivan Enderlin
5ace3cfa2b fix(runtime-c-api) Remove unsafe blocks inside unsafe function.
This patch removes `unsafe { … }` blocks inside `unsafe` functions.

This patch also removes some warnings about camel case. All structures
with a C representation are automatically not mangle, and allow non
camel case.
2019-03-05 10:07:08 +01:00
Brandon Fish
2077fb448a Fix C API table/global/memory imports 2019-03-02 22:28:00 -06:00
Brandon Fish
adfdf4d85d Merge branch 'master' into feature/add-c-api-module-import-descriptors 2019-03-01 12:50:35 -06:00
Brandon Fish
0792cc7018 Merge branch 'master' into feature/c-api-call-an-exported-func 2019-03-01 12:14:56 -06:00
Brandon Fish
358d653b18
Merge branch 'master' into feature/add-c-api-module-export-descriptors 2019-02-27 23:21:23 -06:00
Brandon Fish
889fc3f432
Merge branch 'master' into feature/add-c-api-module-import-descriptors 2019-02-27 23:21:01 -06:00
Brandon Fish
02eac589f4 Merge branch 'master' into feature/c-api-call-an-exported-func 2019-02-27 23:19:50 -06:00
Syrus
60f8f15db3 Updated version to 0.2.1 2019-02-27 17:20:49 -08:00
Mackenzie Clark
2a7a8c0069
newline in test-module-imports.c 2019-02-27 10:41:22 -08:00
Mackenzie Clark
c4566f0b39
Merge branch 'master' into feature/add-c-api-module-export-descriptors 2019-02-27 10:28:18 -08:00
Syrus
53c8603464 Updated crates version to 0.2.0 2019-02-25 13:33:33 -08:00
Brandon Fish
b008a054de Fix C API to allow calling an exported func 2019-02-24 12:22:24 -06:00
Brandon Fish
1dfa106850 Add C API module import descriptors 2019-02-23 18:25:51 -06:00
Brandon Fish
17fe7bdaea Add C API module export descriptors 2019-02-23 15:41:38 -06:00
Mackenzie Clark
82eef13f41
Create a grow error and refactor grow impl to return result (#191) 2019-02-22 22:18:59 -08:00
Brandon Fish
c9969f269c Use minimum limit as initial table size (#196) 2019-02-22 11:16:15 -08:00
Brandon Fish
ac57a1bc71 Add C API module_instantiate function 2019-02-20 23:08:23 -06:00
Brandon Fish
b073145dbb Clone import in instantiate to prevent import move 2019-02-20 09:52:42 -06:00
Brandon Fish
d2f3023191 Allow specifying optional max value in limits 2019-02-19 00:05:08 -06:00
Brandon Fish
380d766943 Convert from Box into/from raw to pointer ref-deref to fix free issue 2019-02-18 23:30:08 -06:00
Brandon Fish
123d55cb4a Remove commented out code, cleanup build warnings 2019-02-17 17:10:15 -06:00
Brandon Fish
ee81560e06 Cleanup tests 2019-02-17 16:51:59 -06:00
Brandon Fish
a77d1be983 Remove unused API functions 2019-02-17 14:48:30 -06:00
Brandon Fish
36767e0bd6 Move ctx pointer to first parameter to fix test 2019-02-17 14:39:26 -06:00
Brandon Fish
7bb947aba7 Add func signature lookup functions 2019-02-17 14:12:05 -06:00
Brandon Fish
56079ad589 Add compile Module function 2019-02-15 19:47:00 -06:00
Brandon Fish
3ebb80e50e Update imports and add func_new 2019-02-15 09:40:28 -06:00
Brandon Fish
bfd5e21605 Add export_name and export_func 2019-02-14 00:00:39 -06:00
Brandon Fish
93979aeae2 Add get exports from instance 2019-02-13 20:02:11 -06:00
Brandon Fish
27cbfc0b0b Add documentation to API functions 2019-02-11 23:14:32 -06:00
Brandon Fish
34c45aee3d Update last error for every error result 2019-02-11 20:08:54 -06:00
Brandon Fish
019ef9ea01 Consolidate result type to one enum 2019-02-11 19:07:28 -06:00
Brandon Fish
b70e319f5c Add initial error messaging 2019-02-10 17:57:23 -06:00
Brandon Fish
66bf13c9dd Add memory data function 2019-02-10 15:20:35 -06:00
Brandon Fish
a502da58e3 Fix import object destroy 2019-02-10 14:27:08 -06:00
Brandon Fish
7ef472dae2 Add instance context memory 2019-02-10 14:24:36 -06:00
Brandon Fish
0cfe864fe6 Add Memory data length 2019-02-10 14:14:42 -06:00
Brandon Fish
2fa9cec0ed Add include guard 2019-02-09 18:07:05 -06:00
Brandon Fish
a0288c87ac Add Memory Grow C API 2019-02-09 17:53:03 -06:00
Brandon Fish
94c5acedbf Add basic Global API 2019-02-09 17:39:15 -06:00
Brandon Fish
8364c39b4c Add Table grow function 2019-02-09 13:58:50 -06:00
Brandon Fish
4e5e525626 Add basic Table functions 2019-02-09 13:37:07 -06:00
Brandon Fish
c3707efa08 Update for merge from master 2019-02-09 13:09:54 -06:00