52 lines · c
1/* ===-------- vadefs.h ---------------------------------------------------===2 *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-exception6 *7 *===-----------------------------------------------------------------------===8 */9 10/* Only include this if we are aiming for MSVC compatibility. */11#ifndef _MSC_VER12#include_next <vadefs.h>13#else14 15#ifndef __clang_vadefs_h16#define __clang_vadefs_h17 18#include_next <vadefs.h>19 20/* Override macros from vadefs.h with definitions that work with Clang. */21#ifdef _crt_va_start22#undef _crt_va_start23#define _crt_va_start(ap, param) __builtin_va_start(ap, param)24#endif25#ifdef _crt_va_end26#undef _crt_va_end27#define _crt_va_end(ap) __builtin_va_end(ap)28#endif29#ifdef _crt_va_arg30#undef _crt_va_arg31#define _crt_va_arg(ap, type) __builtin_va_arg(ap, type)32#endif33 34/* VS 2015 switched to double underscore names, which is an improvement, but now35 * we have to intercept those names too.36 */37#ifdef __crt_va_start38#undef __crt_va_start39#define __crt_va_start(ap, param) __builtin_va_start(ap, param)40#endif41#ifdef __crt_va_end42#undef __crt_va_end43#define __crt_va_end(ap) __builtin_va_end(ap)44#endif45#ifdef __crt_va_arg46#undef __crt_va_arg47#define __crt_va_arg(ap, type) __builtin_va_arg(ap, type)48#endif49 50#endif51#endif52