long sprintf(char *s, const char *st, ...) { long res; __builtin_va_list va; __builtin_va_start(va, st); res = _vsprintf(s, st, va); __builtin_va_end(va); return res; }
int32_t Bsprintf(char *str, const char *format, ...) { va_list ap; int32_t r; va_start(ap, format); #ifdef _MSC_VER r = _vsprintf(str, format, ap); #else r = vsprintf(str, format, ap); #endif va_end(ap); return r; }
/* emulate textprintf() */ void textprintf(const ALLEGRO_FONT *f, int x, int y, ALLEGRO_COLOR color, const char *fmt, ...) { va_list ap; char buf[256]; va_start(ap, fmt); #if defined(__WATCOMC__) || defined(_MSC_VER) _vsprintf(buf, fmt, ap); #else vsnprintf(buf, sizeof(buf), fmt, ap); #endif va_end(ap); textout(f, buf, x, y, color); }
static void errprintf(char *s, ...) { va_list a; va_start(a, s); _vfprintf(stderr, s, a); va_end(a); #ifndef NO_LISTING_OUTPUT if (listingstream != NULL) { check_error_buffer(); va_start(a, s); errsavep += (_vsprintf(&errsaves[errsavep], s, a), strlen(&errsaves[errsavep])); va_end(a); } #endif }