Mercurial > projects > ldc
view test/vararg1.d @ 306:0baca2feb554 trunk
[svn r327] Fixed some more MinGW32 issues. It's now very close to working.
Fixed problems with inline asm like: mov EAX, FS:4 , which incidentally is used in the runtime to get the stack bottom, on Windows.
author | lindquist |
---|---|
date | Fri, 27 Jun 2008 23:58:22 +0200 |
parents | d9d5d59873d8 |
children |
line wrap: on
line source
module vararg1; import tango.stdc.stdarg; extern(C) int add(int n, ...) { va_list ap=void; va_start(ap, n); int r; for (int i=0; i<n; i++) r += va_arg!(int)(ap); va_end(ap); return r; } void main() { int i = add(4,1,2,3,4); assert(i == 10); }