Support dtor sections on Mach-O.
[libfirm] / ir / obstack_win / obstack_printf.c
index 65f06dc..94e7458 100644 (file)
@@ -6,16 +6,23 @@
 #define vsnprintf _vsnprintf
 #endif
 
-int obstack_printf(struct obstack *obst, const char *fmt, ...)
+int obstack_vprintf(struct obstack *obst, const char *fmt, va_list ap)
 {
-  char buf[1024];
-  va_list ap;
-  int len;
+       char buf[1024];
+       int len;
+
+       len = vsnprintf(buf, sizeof(buf), fmt, ap);
+       obstack_grow(obst, buf, len);
+       return len;
+}
 
-  va_start(ap, fmt);
-  len = vsnprintf(buf, sizeof(buf), fmt, ap);
-  obstack_grow(obst, buf, len);
-  va_end(ap);
+int obstack_printf(struct obstack *obst, const char *fmt, ...)
+{
+       va_list ap;
+       int len;
 
-  return len;
+       va_start(ap, fmt);
+       len = obstack_vprintf(obst, fmt, ap);
+       va_end(ap);
+       return len;
 }