Some more cleanup: Put the return type and other specifiers on the same line as the...
[libfirm] / ir / obstack_win / obstack_printf.c
1 #include <stdarg.h>
2 #include <stdio.h>
3 #include "obstack.h"
4
5 #ifdef _WIN32
6 #define vsnprintf _vsnprintf
7 #endif
8
9 int obstack_vprintf(struct obstack *obst, const char *fmt, va_list ap)
10 {
11         char buf[1024];
12         int len;
13
14         len = vsnprintf(buf, sizeof(buf), fmt, ap);
15         obstack_grow(obst, buf, len);
16         return len;
17 }
18
19 int obstack_printf(struct obstack *obst, const char *fmt, ...)
20 {
21         va_list ap;
22         int len;
23
24         va_start(ap, fmt);
25         len = obstack_vprintf(obst, fmt, ap);
26         va_end(ap);
27         return len;
28 }