summaryrefslogtreecommitdiff
path: root/source/fitz/buffer.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2014-03-25 20:28:20 +0100
committerTor Andersson <tor.andersson@artifex.com>2014-03-25 20:28:32 +0100
commitecfb80367e891394f5bc0eaf52523b7fc71ab878 (patch)
tree3d3be1a862ddb5f6369bfa6aa813673339c555dd /source/fitz/buffer.c
parent680156458242c87bfa9f3013cc5d23308409e8de (diff)
downloadmupdf-ecfb80367e891394f5bc0eaf52523b7fc71ab878.tar.xz
Add va_copy/va_copy_end macros to support both C89 and C99.
Diffstat (limited to 'source/fitz/buffer.c')
-rw-r--r--source/fitz/buffer.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/source/fitz/buffer.c b/source/fitz/buffer.c
index e9295a26..4a87b4ca 100644
--- a/source/fitz/buffer.c
+++ b/source/fitz/buffer.c
@@ -237,15 +237,9 @@ fz_buffer_vprintf(fz_context *ctx, fz_buffer *buffer, const char *fmt, va_list o
va_list args;
slack = buffer->cap - buffer->len;
-#ifdef _MSC_VER /* Microsoft Visual C */
- args = old_args;
-#else
va_copy(args, old_args);
-#endif
len = fz_vsnprintf((char *)buffer->data + buffer->len, slack, fmt, args);
-#ifndef _MSC_VER
- va_end(args);
-#endif
+ va_copy_end(args);
/* len = number of chars written, not including the terminating
* NULL, so len+1 > slack means "truncated". */
@@ -255,15 +249,9 @@ fz_buffer_vprintf(fz_context *ctx, fz_buffer *buffer, const char *fmt, va_list o
fz_ensure_buffer(ctx, buffer, buffer->len + len);
slack = buffer->cap - buffer->len;
-#ifdef _MSC_VER /* Microsoft Visual C */
- args = old_args;
-#else
va_copy(args, old_args);
-#endif
len = fz_vsnprintf((char *)buffer->data + buffer->len, slack, fmt, args);
-#ifndef _MSC_VER
- va_end(args);
-#endif
+ va_copy_end(args);
}
buffer->len += len;