forked from Lainports/freebsd-ports
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
75 lines
2.4 KiB
C++
75 lines
2.4 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
|
|
*
|
|
*===-----------------------------------------------------------------------===
|
|
*/
|
|
|
|
/*
|
|
* This header is designed to be included multiple times. If any of the __need_
|
|
* macros are defined, then only that subset of interfaces are provided. This
|
|
* can be useful for POSIX headers that need to not expose all of stdarg.h, but
|
|
* need to use some of its interfaces. Otherwise this header provides all of
|
|
* the expected interfaces.
|
|
*
|
|
* When clang modules are enabled, this header is a textual header to support
|
|
* the multiple include behavior. As such, it doesn't directly declare anything
|
|
* so that it doesn't add duplicate declarations to all of its includers'
|
|
* modules.
|
|
*/
|
|
#if defined(__MVS__) && __has_include_next(<stdarg.h>)
|
|
#undef __need___va_list
|
|
#undef __need_va_list
|
|
#undef __need_va_arg
|
|
#undef __need___va_copy
|
|
#undef __need_va_copy
|
|
#include <__stdarg_header_macro.h>
|
|
#include_next <stdarg.h>
|
|
|
|
#else
|
|
#if !defined(__need___va_list) && !defined(__need_va_list) && \
|
|
!defined(__need_va_arg) && !defined(__need___va_copy) && \
|
|
!defined(__need_va_copy)
|
|
#define __need___va_list
|
|
#define __need_va_list
|
|
#define __need_va_arg
|
|
#define __need___va_copy
|
|
/* 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.
|
|
*/
|
|
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
|
|
(defined(__cplusplus) && __cplusplus >= 201103L) || \
|
|
!defined(__STRICT_ANSI__)
|
|
#define __need_va_copy
|
|
#endif
|
|
#include <__stdarg_header_macro.h>
|
|
#endif
|
|
|
|
#ifdef __need___va_list
|
|
#include <__stdarg___gnuc_va_list.h>
|
|
#undef __need___va_list
|
|
#endif /* defined(__need___va_list) */
|
|
|
|
#ifdef __need_va_list
|
|
#include <__stdarg_va_list.h>
|
|
#undef __need_va_list
|
|
#endif /* defined(__need_va_list) */
|
|
|
|
#ifdef __need_va_arg
|
|
#include <__stdarg_va_arg.h>
|
|
#undef __need_va_arg
|
|
#endif /* defined(__need_va_arg) */
|
|
|
|
#ifdef __need___va_copy
|
|
#include <__stdarg___va_copy.h>
|
|
#undef __need___va_copy
|
|
#endif /* defined(__need___va_copy) */
|
|
|
|
#ifdef __need_va_copy
|
|
#include <__stdarg_va_copy.h>
|
|
#undef __need_va_copy
|
|
#endif /* defined(__need_va_copy) */
|
|
|
|
#endif /* __MVS__ */
|