[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / lib / Headers / stdarg.h
blobdc7becff670f403b20facee3f7901f41a214346c
1 /*===---- stdarg.h - Variable argument handling ----------------------------===
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 #ifndef __STDARG_H
11 #define __STDARG_H
13 #ifndef _VA_LIST
14 typedef __builtin_va_list va_list;
15 #define _VA_LIST
16 #endif
17 #define va_start(ap, param) __builtin_va_start(ap, param)
18 #define va_end(ap) __builtin_va_end(ap)
19 #define va_arg(ap, type) __builtin_va_arg(ap, type)
21 /* GCC always defines __va_copy, but does not define va_copy unless in c99 mode
22 * or -ansi is not specified, since it was not part of C90.
24 #define __va_copy(d,s) __builtin_va_copy(d,s)
26 #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
27 (defined(__cplusplus) && __cplusplus >= 201103L) || \
28 !defined(__STRICT_ANSI__)
29 #define va_copy(dest, src) __builtin_va_copy(dest, src)
30 #endif
32 #ifndef __GNUC_VA_LIST
33 #define __GNUC_VA_LIST 1
34 typedef __builtin_va_list __gnuc_va_list;
35 #endif
37 #endif /* __STDARG_H */