[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / lib / Headers / vadefs.h
blobb6175684469cd1b39c395659be07557d3040ea32
1 /* ===-------- vadefs.h ---------------------------------------------------===
3 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 * See https://llvm.org/LICENSE.txt for license information.
5 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 *===-----------------------------------------------------------------------===
8 */
10 /* Only include this if we are aiming for MSVC compatibility. */
11 #ifndef _MSC_VER
12 #include_next <vadefs.h>
13 #else
15 #ifndef __clang_vadefs_h
16 #define __clang_vadefs_h
18 #include_next <vadefs.h>
20 /* Override macros from vadefs.h with definitions that work with Clang. */
21 #ifdef _crt_va_start
22 #undef _crt_va_start
23 #define _crt_va_start(ap, param) __builtin_va_start(ap, param)
24 #endif
25 #ifdef _crt_va_end
26 #undef _crt_va_end
27 #define _crt_va_end(ap) __builtin_va_end(ap)
28 #endif
29 #ifdef _crt_va_arg
30 #undef _crt_va_arg
31 #define _crt_va_arg(ap, type) __builtin_va_arg(ap, type)
32 #endif
34 /* VS 2015 switched to double underscore names, which is an improvement, but now
35 * we have to intercept those names too.
37 #ifdef __crt_va_start
38 #undef __crt_va_start
39 #define __crt_va_start(ap, param) __builtin_va_start(ap, param)
40 #endif
41 #ifdef __crt_va_end
42 #undef __crt_va_end
43 #define __crt_va_end(ap) __builtin_va_end(ap)
44 #endif
45 #ifdef __crt_va_arg
46 #undef __crt_va_arg
47 #define __crt_va_arg(ap, type) __builtin_va_arg(ap, type)
48 #endif
50 #endif
51 #endif