summaryrefslogtreecommitdiffhomepage
path: root/ir/obstack
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2013-08-27 11:06:48 +0200
committerChristoph Mallon <christoph.mallon@gmx.de>2013-08-27 17:45:47 +0200
commitd94432c85469d13dee773f5eb90d6dde71d95212 (patch)
tree9938292112ff06af32836a184dbe4ef5639a2562 /ir/obstack
parent55974efdf61807f41db1e0729ff4af154ab3c467 (diff)
Avoid duplicate function header in different #if cases.
Diffstat (limited to 'ir/obstack')
-rw-r--r--ir/obstack/obstack_printf.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/ir/obstack/obstack_printf.c b/ir/obstack/obstack_printf.c
index a4d95da..da0c6eb 100644
--- a/ir/obstack/obstack_printf.c
+++ b/ir/obstack/obstack_printf.c
@@ -8,18 +8,15 @@
#include <assert.h>
#include "obstack.h"
-#ifdef _WIN32
-/* win32/C89 has no va_copy function... so we have to use the stupid fixed-length version */
int obstack_vprintf(struct obstack *obst, const char *fmt, va_list ap) FIRM_NOTHROW
{
+#ifdef _WIN32
+ /* win32/C89 has no va_copy function... so we have to use the stupid fixed-length version */
char buf[16384];
int len = _vsnprintf(buf, sizeof(buf), fmt, ap);
obstack_grow(obst, buf, len);
return len;
-}
#else
-int obstack_vprintf(struct obstack *obst, const char *fmt, va_list ap) FIRM_NOTHROW
-{
char buf[128];
char *buffer = buf;
size_t size = sizeof(buf);
@@ -55,8 +52,8 @@ int obstack_vprintf(struct obstack *obst, const char *fmt, va_list ap) FIRM_NOTH
free(buffer);
return len;
-}
#endif
+}
int obstack_printf(struct obstack *obst, const char *fmt, ...) FIRM_NOTHROW
{