forked from emscripten-core/emscripten
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathffi.c
More file actions
33 lines (26 loc) · 705 Bytes
/
ffi.c
File metadata and controls
33 lines (26 loc) · 705 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
* Copyright 2017 The Emscripten Authors. All rights reserved.
* Emscripten is available under two separate licenses, the MIT license and the
* University of Illinois/NCSA Open Source License. Both these licenses can be
* found in the LICENSE file.
*/
#include <stdio.h>
#include <math.h>
float add_f (float a, float b) {
return a + b;
}
long long add_ll (long long a, long long b) {
return a + b;
}
extern float import_f(float x);
extern long long import_ll(long long x);
int main () {
float a = 1.2,
b = import_f((float)3.4),
c;
c = add_f(a, b);
long long d = 1,
e = import_ll((long long)2),
f;
f = add_ll(d, e);
}