| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
| |
Store templated wasm2c code as .h/.c; build templates on demand
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The module prefix is no longer optional and is now set by default to the
name of the module as given in the name section, or taken from the name
of the input file.
A new `-n/--module-name` command line flag can also be used to override.
The prefix used by the generated code is now fixed at wasm2c time which
makes the output code easier to read and also avoid the symbol pasting
in the C pre-processor which makes the source hard to understand. For
example, it makes symbols hard to `grep` for.
|
| |
|
|
|
|
|
| |
Use stricter compiler settings and fix the resulting warnings.
This is precursor to landing windows compiler support for wasm2c.
See #1843.
|
|
|
|
|
|
|
|
|
|
| |
This example demonstrates how to use imported functions. The `rot13`
program takes each command line argument, and rot13-encodes it.
The exported `rot13` function has no arguments, and instead calls back
into the program (via `fill_buf`) with a buffer to fill in. When the
function finishes it calls `buf_done`.
(rot13.wat is the same as in src/test-interp.cc.)
|
|
|
| |
Also remove `WASM_RT_DEFINE_EXTERNAL`, as it doesn't seem to be used.
|
|
|
| |
This makes it easier to use outside of running wasm2c spec tests.
|
|
This uses a very simple template syntax, without any advanced features:
```
%%top
...
%%bottom
...
```
This template will generate output with two C strings:
```
const char SECTION_NAME(top)[] = ...
...
const char SECTION_NAME(bottom)[] = ...
...
```
To update the generated files, run `make update-wasm2c`.
|