xref: /illumos-gate/usr/src/head/iso/stdarg_iso.h (revision 78801af7286cd73dbc996d470f789e75993cf15d)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*	Copyright (c) 1988 AT&T	*/
23 /*	  All Rights Reserved	*/
24 
25 
26 /*
27  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
28  * Use is subject to license terms.
29  */
30 
31 /*
32  * An application should not include this header directly.  Instead it
33  * should be included only through the inclusion of other Sun headers.
34  *
35  * The contents of this header is limited to identifiers specified in the
36  * C Standard.  Any new identifiers specified in future amendments to the
37  * C Standard must be placed in this header.  If these new identifiers
38  * are required to also be in the C++ Standard "std" namespace, then for
39  * anything other than macro definitions, corresponding "using" directives
40  * must also be added to <stdarg.h>.
41  */
42 
43 #ifndef _ISO_STDARG_ISO_H
44 #define	_ISO_STDARG_ISO_H
45 
46 /*
47  * This header defines the ISO C 1989 and ISO C++ 1998 variable
48  * argument definitions.
49  *
50  * The varargs definitions within this header are defined in terms of
51  * implementation definitions.  These implementation definitions reside
52  * in <sys/va_impl.h>.  This organization enables protected use of
53  * the implementation by other standard headers without introducing
54  * names into the users' namespace.
55  */
56 
57 #include <sys/va_impl.h>
58 
59 #ifdef	__cplusplus
60 extern "C" {
61 #endif
62 
63 #if __cplusplus >= 199711L
64 namespace std {
65 typedef __va_list va_list;
66 }
67 #elif !defined(_VA_LIST)
68 #define	_VA_LIST
69 typedef __va_list va_list;
70 #endif
71 
72 #define	va_start(list, name)	__va_start(list, name)
73 #define	va_arg(list, type)	__va_arg(list, type)
74 #define	va_end(list)		__va_end(list)
75 
76 #ifdef	__cplusplus
77 }
78 #endif
79 
80 #endif	/* _ISO_STDARG_ISO_H */
81