Mercurial > projects > ldc
diff dmd/root.c @ 761:fa306ca8843b
Applied fvbommel's patch from #112
Added missing TypeInfoInvariant codegen for D2
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Wed, 12 Nov 2008 02:30:28 +0100 |
parents | 4ac97ec7c18e |
children | bc982f1ad106 |
line wrap: on
line diff
--- a/dmd/root.c Wed Nov 12 00:19:18 2008 +0100 +++ b/dmd/root.c Wed Nov 12 02:30:28 2008 +0100 @@ -1613,6 +1613,11 @@ unsigned psize; int count; + // On some platforms (i.e. x86_64) va_list is an array and thus passed by + // reference. Copy the input list so we can copy it back before retrying. + va_list orig_args; + va_copy(orig_args, args); + p = buffer; psize = sizeof(buffer); for (;;) @@ -1622,8 +1627,7 @@ if (count != -1) break; psize *= 2; -#endif -#if POSIX +#elif POSIX count = vsnprintf(p,psize,format,args); if (count == -1) psize *= 2; @@ -1632,6 +1636,7 @@ else break; #endif + va_copy(args, orig_args); p = (char *) alloca(psize); // buffer too small, try again with larger size } write(p,count);