xref: /freebsd/contrib/llvm-project/clang/lib/Headers/stdarg.h (revision 43a5ec4eb41567cc92586503212743d89686d78f)
1 /*===---- stdarg.h - Variable argument handling ----------------------------===
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-exception
6  *
7  *===-----------------------------------------------------------------------===
8  */
9 
10 #ifndef __STDARG_H
11 #define __STDARG_H
12 
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)
20 
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.
23  */
24 #define __va_copy(d,s) __builtin_va_copy(d,s)
25 
26 #if __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L || !defined(__STRICT_ANSI__)
27 #define va_copy(dest, src)  __builtin_va_copy(dest, src)
28 #endif
29 
30 #ifndef __GNUC_VA_LIST
31 #define __GNUC_VA_LIST 1
32 typedef __builtin_va_list __gnuc_va_list;
33 #endif
34 
35 #endif /* __STDARG_H */
36