mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-09 21:43:40 +00:00
cgo: add support for variadic functions
This doesn't yet add support for actually making use of variadic
functions, but at least allows (unintended) variadic functions like the
following to work:
void foo();
This commit is contained in:
committed by
Ron Evans
parent
5502182642
commit
2e9c3a1d8d
Vendored
+8
@@ -34,6 +34,14 @@ int doCallback(int a, int b, binop_t callback) {
|
||||
return callback(a, b);
|
||||
}
|
||||
|
||||
int variadic0() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int variadic2(int x, int y, ...) {
|
||||
return x * y;
|
||||
}
|
||||
|
||||
void store(int value, int *ptr) {
|
||||
*ptr = value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user