[AMDGPU][AsmParser][NFC] Get rid of custom default operand handlers.
[llvm-project.git] / clang / lib / Headers / stdarg.h
blobba978721f1f3dd0efe43e12770daca34791aac5c
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
12 #ifndef __GNUC_VA_LIST
13 #define __GNUC_VA_LIST
14 typedef __builtin_va_list __gnuc_va_list;
15 #endif
17 #ifdef __need___va_list
18 #undef __need___va_list
19 #else
20 #define __STDARG_H
21 #ifndef _VA_LIST
22 typedef __builtin_va_list va_list;
23 #define _VA_LIST
24 #endif
26 /* FIXME: This is using the placeholder dates Clang produces for these macros
27 in C2x mode; switch to the correct values once they've been published. */
28 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000L
29 /* C2x does not require the second parameter for va_start. */
30 #define va_start(ap, ...) __builtin_va_start(ap, 0)
31 #else
32 /* Versions before C2x do require the second parameter. */
33 #define va_start(ap, param) __builtin_va_start(ap, param)
34 #endif
35 #define va_end(ap) __builtin_va_end(ap)
36 #define va_arg(ap, type) __builtin_va_arg(ap, type)
38 /* GCC always defines __va_copy, but does not define va_copy unless in c99 mode
39 * or -ansi is not specified, since it was not part of C90.
41 #define __va_copy(d,s) __builtin_va_copy(d,s)
43 #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
44 (defined(__cplusplus) && __cplusplus >= 201103L) || \
45 !defined(__STRICT_ANSI__)
46 #define va_copy(dest, src) __builtin_va_copy(dest, src)
47 #endif
49 #endif /* __STDARG_H */
51 #endif /* not __STDARG_H */