[PATCH] MS Compat: interpose vadefs.h to fix definitions of _crt_va_{start, end, arg} (PR21247)

Reid Kleckner rnk at google.com
Tue Oct 14 15:19:36 PDT 2014


================
Comment at: lib/Headers/vadefs.h:24
@@ +23,3 @@
+
+/* Only include this if we're compiling for the Windows platform. */
+#ifndef _MSC_VER
----------------
I'd wordsmith this to "Only include this if we're aiming for MSVC compatibility."

================
Comment at: lib/Headers/vadefs.h:32
@@ +31,3 @@
+
+#include_next <vadefs.h>
+
----------------
Should we only do this if __has_include(<vadefs.h>) ?

================
Comment at: lib/Headers/vadefs.h:34
@@ +33,3 @@
+
+/* Override macros from vadefs.h with definitions that work with Clang. */
+#define _crt_va_start(ap, param) __builtin_va_start(ap, param)
----------------
I think we should do "#ifndef _crt_va_start #undef _crt_va_start" to avoid warnings with -Wsystem-headers.

http://reviews.llvm.org/D5784






More information about the cfe-commits mailing list