Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zlib-wasm
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nagayama15
zlib-wasm
Commits
400efaf4
Commit
400efaf4
authored
Nov 11, 2019
by
nagayama15
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the build script
parent
e427499e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
3 deletions
+16
-3
build.js
build.js
+2
-1
stdio.h
src/include/stdio.h
+1
-2
zlib-exports.c
src/zlib-exports.c
+5
-0
test.js
test.js
+8
-0
No files found.
build.js
View file @
400efaf4
...
...
@@ -66,6 +66,8 @@ async function opt(input, output, optflags, cwd) {
}
const
srcs
=
[
'zlib-exports'
,
'zlib/adler32'
,
'zlib/compress'
,
'zlib/crc32'
,
...
...
@@ -81,7 +83,6 @@ const srcs = [
'zlib/trees'
,
'zlib/uncompr'
,
'zlib/zutil'
,
'zlib-exports'
,
];
(
async
()
=>
{
...
...
src/include/stdio.h
View file @
400efaf4
...
...
@@ -3,5 +3,4 @@
#include <stddef.h>
int
snprintf
(
char
*
,
size_t
,
const
char
*
,
...);
int
vsnprintf
(
char
*
,
size_t
,
const
char
*
,
...);
int
vsnprintf
(
char
*
,
size_t
,
const
char
*
,
...);
int
vsnprintf
(
char
*
,
size_t
,
const
char
*
,
__builtin_va_list
);
src/zlib-exports.c
View file @
400efaf4
#include <webassembly.h>
#include <stdlib.h>
#include "import.h"
export
int
add2
(
int
a
,
int
b
)
{
return
a
+
b
;
}
test.js
0 → 100644
View file @
400efaf4
const
assert
=
require
(
'assert'
);
const
wasm
=
require
(
'webassembly'
);
(
async
()
=>
{
const
zlib
=
await
wasm
.
load
(
`
${
__dirname
}
/build/zlib.wasm`
);
assert
.
strictEqual
(
zlib
.
exports
.
add2
(
8
,
5
),
13
);
})();
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment