http://d.puremagic.com/issues/show_bug.cgi?id=2479


Don <clugd...@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugd...@yahoo.com.au




--- Comment #4 from Don <clugd...@yahoo.com.au>  2009-08-31 01:59:58 PDT ---
Even further reduced, removing all imports. My patch to bug 814 does not fix
this.
------
alias void* va_list;

T va_arg(T)(inout va_list _argptr) {
    T arg = *cast(T*)_argptr;
    _argptr = _argptr + ((T.sizeof + int.sizeof - 1) & ~(int.sizeof - 1));
    return arg;
}

void doFormat(void delegate(dchar) myputc, TypeInfo[] args, va_list
argptr){
    string fmt = va_arg!(string)(argptr);
    assert(!(fmt is null)); // fires when it shouldn't.
}

char[] sformat(char[] s, ...){
    void putc(dchar c) { s[0] = cast(char)c; }

    doFormat(&putc, _arguments, _argptr);
    return s[0 .. 1];
}

void main(){
    char[32] tmp;
    sformat(tmp, "%s", "hi");
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to