r222473 - Intercept __crt_va_* used by MSVC "14"

Reid Kleckner reid at kleckner.net
Thu Nov 20 14:44:03 PST 2014


Author: rnk
Date: Thu Nov 20 16:44:03 2014
New Revision: 222473

URL: http://llvm.org/viewvc/llvm-project?rev=222473&view=rev
Log:
Intercept __crt_va_* used by MSVC "14"

Moving further into the implementor's namespace is good, but now we have
one more name to intercept.

Modified:
    cfe/trunk/lib/Headers/vadefs.h

Modified: cfe/trunk/lib/Headers/vadefs.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/vadefs.h?rev=222473&r1=222472&r2=222473&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/vadefs.h (original)
+++ cfe/trunk/lib/Headers/vadefs.h Thu Nov 20 16:44:03 2014
@@ -45,5 +45,21 @@
 #define _crt_va_arg(ap, type)    __builtin_va_arg(ap, type)
 #endif
 
+/* VS 2015 switched to double underscore names, which is an improvement, but now
+ * we have to intercept those names too.
+ */
+#ifdef __crt_va_start
+#undef __crt_va_start
+#define __crt_va_start(ap, param) __builtin_va_start(ap, param)
+#endif
+#ifdef __crt_va_end
+#undef __crt_va_end
+#define __crt_va_end(ap)          __builtin_va_end(ap)
+#endif
+#ifdef __crt_va_arg
+#undef __crt_va_arg
+#define __crt_va_arg(ap, type)    __builtin_va_arg(ap, type)
+#endif
+
 #endif
 #endif





More information about the cfe-commits mailing list