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:
Ayke van Laethem
2021-02-07 16:02:16 +01:00
committed by Ron Evans
parent 5502182642
commit 2e9c3a1d8d
9 changed files with 77 additions and 11 deletions
+8
View File
@@ -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;
}