summaryrefslogtreecommitdiff
path: root/upb
diff options
context:
space:
mode:
authorJosh Haberman <jhaberman@gmail.com>2015-06-06 16:27:40 -0700
committerJosh Haberman <jhaberman@gmail.com>2015-06-06 16:27:40 -0700
commitd9485c28ed42df3f1a418f446203c780b6e31e3a (patch)
treeeab2f13454fefa2961cb3ce40270ba59e2179c16 /upb
parent19a973a85ef5a2eaf1ca59d09ec2d6e972c0cd24 (diff)
Fix for va_copy.
Diffstat (limited to 'upb')
-rw-r--r--upb/pb/textprinter.c6
-rw-r--r--upb/upb.h4
2 files changed, 4 insertions, 6 deletions
diff --git a/upb/pb/textprinter.c b/upb/pb/textprinter.c
index 269881b..4932468 100644
--- a/upb/pb/textprinter.c
+++ b/upb/pb/textprinter.c
@@ -96,10 +96,6 @@ static int putescaped(upb_textprinter *p, const char *buf, size_t len,
return 0;
}
-#ifdef __GNUC__
-#define va_copy(a, b) __va_copy(a, b)
-#endif
-
bool putf(upb_textprinter *p, const char *fmt, ...) {
va_list args;
va_list args_copy;
@@ -111,7 +107,7 @@ bool putf(upb_textprinter *p, const char *fmt, ...) {
va_start(args, fmt);
/* Run once to get the length of the string. */
- va_copy(args_copy, args);
+ _upb_va_copy(args_copy, args);
len = _upb_vsnprintf(NULL, 0, fmt, args_copy);
va_end(args_copy);
diff --git a/upb/upb.h b/upb/upb.h
index ad094f4..294b2fa 100644
--- a/upb/upb.h
+++ b/upb/upb.h
@@ -52,12 +52,14 @@
#ifdef __GNUC__
#define _upb_snprintf __builtin_snprintf
#define _upb_vsnprintf __builtin_vsnprintf
+#define _upb_va_copy(a, b) __va_copy(a, b)
#elif __STDC_VERSION__ >= 199901L
/* C99 versions. */
#define _upb_snprintf snprintf
#define _upb_vsnprintf vsnprintf
+#define _upb_va_copy(a, b) va_copy(a, b)
#else
-#error Need implementations of [v]snprintf
+#error Need implementations of [v]snprintf and va_copy
#endif
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback