/* Copyright (c) 2001-2009 by SoftIntegration, Inc. All Rights Reserved */
#include <wchar.h>
int wsprintf(wchar_t *buffer, char *format, ...) {
    va_list ap;
    void *fptr;
    int retval;

    va_start(ap, format);
#if defined(_WIN32_)
    dlrunfun(_Ch_wsprintf, &retval,NULL, buffer, format, ap);
#else
    fptr = dlsym(_ChWchar_handle, "wsprintf_chdl");
    if(fptr == NULL) {
        fprintf(_stderr, "Error: %s(): dlsym(): %s\n", __func__,  dlerror());
        return -1;
    }
    dlrunfun(fptr, &retval,NULL, buffer, format, ap);
#endif
    va_end(ap);
    return retval;
}
