freebsd-ports/devel/wasi-libc/files/llvm17/stdarg.h
Charlie Li 84b600fb9f
wasi: update to latest commit past sdk-22
devel/wasi-libc is now flavourised per supported LLVM version. Each
flavour includes/copies the corresponding clang's stdarg.h and
stddef.h instead of simply using the latest clang release.

Technically upstream dropped support for LLVM < 18, but the commit
doing so admittedly operated under an uncertain assumption. LLVM
17 is still supported in these ports for the benefit of Rust and
gecko@ ports, which specify LLVM 17 minimum, and to facilitate LTO
with that version. LLVM 19 is also supported in this version, with
the corresponding ports to be committed separately.

Bump PORTREVISION of consumers
2024-10-18 08:38:20 -04:00

51 lines
1.7 KiB
C++

/*===---- stdarg.h - Variable argument handling ----------------------------===
*
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
* See https://llvm.org/LICENSE.txt for license information.
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
*
*===-----------------------------------------------------------------------===
*/
#ifndef __STDARG_H
#ifndef __GNUC_VA_LIST
#define __GNUC_VA_LIST
typedef __builtin_va_list __gnuc_va_list;
#endif
#ifdef __need___va_list
#undef __need___va_list
#else
#define __STDARG_H
#ifndef _VA_LIST
typedef __builtin_va_list va_list;
#define _VA_LIST
#endif
/* FIXME: This is using the placeholder dates Clang produces for these macros
in C2x mode; switch to the correct values once they've been published. */
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000L
/* C2x does not require the second parameter for va_start. */
#define va_start(ap, ...) __builtin_va_start(ap, 0)
#else
/* Versions before C2x do require the second parameter. */
#define va_start(ap, param) __builtin_va_start(ap, param)
#endif
#define va_end(ap) __builtin_va_end(ap)
#define va_arg(ap, type) __builtin_va_arg(ap, type)
/* GCC always defines __va_copy, but does not define va_copy unless in c99 mode
* or -ansi is not specified, since it was not part of C90.
*/
#define __va_copy(d,s) __builtin_va_copy(d,s)
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
(defined(__cplusplus) && __cplusplus >= 201103L) || \
!defined(__STRICT_ANSI__)
#define va_copy(dest, src) __builtin_va_copy(dest, src)
#endif
#endif /* __STDARG_H */
#endif /* not __STDARG_H */