Created
May 8, 2015 07:05
-
-
Save fowlmouth/000cb78b33b1fe2a95fd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{.emit:""" | |
#include <stdarg.h> | |
void foobar(int i, ...) { | |
va_list args; | |
int j; | |
va_start(args, i); | |
for (j = 0; j < i; j++) { | |
int x = va_arg(args, int); | |
printf("%i\n", x); | |
} | |
va_end(args); | |
} | |
""".} | |
proc foobar(i:cint) {.importc, varargs.} | |
proc barfoo(nums:varargs[cint]) = | |
foobar(nums.len.cint, nums, -1i32, -2i32) | |
barfoo(1, 2, 3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment