76 lines · c
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-exception6 *7 *===-----------------------------------------------------------------------===8 */9 10/*11 * This header is designed to be included multiple times. If any of the __need_12 * macros are defined, then only that subset of interfaces are provided. This13 * can be useful for POSIX headers that need to not expose all of stdarg.h, but14 * need to use some of its interfaces. Otherwise this header provides all of15 * the expected interfaces.16 *17 * When clang modules are enabled, this header is a textual header to support18 * the multiple include behavior. As such, it doesn't directly declare anything19 * so that it doesn't add duplicate declarations to all of its includers'20 * modules.21 */22#if defined(__MVS__) && __has_include_next(<stdarg.h>)23#undef __need___va_list24#undef __need_va_list25#undef __need_va_arg26#undef __need___va_copy27#undef __need_va_copy28#include <__stdarg_header_macro.h>29#include_next <stdarg.h>30 31#else32#if !defined(__need___va_list) && !defined(__need_va_list) && \33 !defined(__need_va_arg) && !defined(__need___va_copy) && \34 !defined(__need_va_copy)35#define __need___va_list36#define __need_va_list37#define __need_va_arg38#define __need___va_copy39/* GCC always defines __va_copy, but does not define va_copy unless in c99 mode40 * or -ansi is not specified, since it was not part of C90.41 */42#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \43 (defined(__cplusplus) && __cplusplus >= 201103L) || \44 !defined(__STRICT_ANSI__)45#define __need_va_copy46#endif47#include <__stdarg_header_macro.h>48#endif49 50#ifdef __need___va_list51#include <__stdarg___gnuc_va_list.h>52#undef __need___va_list53#endif /* defined(__need___va_list) */54 55#ifdef __need_va_list56#include <__stdarg_va_list.h>57#undef __need_va_list58#endif /* defined(__need_va_list) */59 60#ifdef __need_va_arg61#include <__stdarg_va_arg.h>62#undef __need_va_arg63#endif /* defined(__need_va_arg) */64 65#ifdef __need___va_copy66#include <__stdarg___va_copy.h>67#undef __need___va_copy68#endif /* defined(__need___va_copy) */69 70#ifdef __need_va_copy71#include <__stdarg_va_copy.h>72#undef __need_va_copy73#endif /* defined(__need_va_copy) */74 75#endif /* __MVS__ */76