January 12, 2018 Problem with function taking variable number of arguments with -m64 | ||||
---|---|---|---|---|
| ||||
// // rdmd -m64 foo.d // module va_arg_x64_windows; void foo(void* a, void* b, void *c, void* d, ...) { import core.vararg : va_arg; import std.stdio : writeln; foreach (arg; _arguments) { if (arg == typeid(int)) { int x = va_arg!(int)(_argptr); writeln("x: ", x); } //else { // writeln("unknown arg type: ", arg.toString()); //} } } void main() { foo(null, null, null, null, 1234, 5678); // expected: // x: 1234 // x: 5678 // output: // x: 0 // x: 1234 } |
Copyright © 1999-2021 by the D Language Foundation