summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-07 05:12:42 +0000
committerChris Lattner <sabre@nondot.org>2009-04-07 05:12:42 +0000
commit33d840cc8f59083b8966a4b88ab330436aabe467 (patch)
treebfd3ef946851bcd0f8de584f2511598c34565fea
parentaed74642cbe4c4f40f19790e6eec762aa72d883b (diff)
downloadbcm5719-llvm-33d840cc8f59083b8966a4b88ab330436aabe467.tar.gz
bcm5719-llvm-33d840cc8f59083b8966a4b88ab330436aabe467.zip
define __va_copy unconditionally, but va_copy only in c99 or non-ansi mode.
Fixes rdar://6759546, some code that actually used __va_copy because they thought it was "more portable". llvm-svn: 68503
-rw-r--r--clang/lib/Headers/stdarg.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Headers/stdarg.h b/clang/lib/Headers/stdarg.h
index b73edb4699b..c436ced97c5 100644
--- a/clang/lib/Headers/stdarg.h
+++ b/clang/lib/Headers/stdarg.h
@@ -30,7 +30,15 @@ typedef __builtin_va_list va_list;
#define va_start(ap, param) __builtin_va_start(ap, param)
#define va_end(ap) __builtin_va_end(ap)
#define va_arg(ap, type) __builtin_va_arg(ap, type)
+
+/* GCC always defines __va_copy, but does not define va_copy unless in c99 mode
+ * or -ansi is not specified, since it was not part of C90.
+ */
+#define __va_copy(d,s) __builtin_va_copy(d,s)
+
+#if __STDC_VERSION__ >= 199900L || !defined(__STRICT_ANSI__)
#define va_copy(dest, src) __builtin_va_copy(dest, src)
+#endif
/* Hack required to make standard headers work, at least on Ubuntu */
#define __GNUC_VA_LIST 1
OpenPOWER on IntegriCloud