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) 1984, 1986, 1987, 1988, 1989 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 #ifndef _SYS_VA_LIST_H
32 #define _SYS_VA_LIST_H
33
34 /*
35 * An application should not include this header directly. Instead it
36 * should be included only through the inclusion of other Sun headers.
37 *
38 * The purpose of this header is to provide the type definitions for
39 * the va_list argument used by a number of printf and printf like
40 * functions. The headers that define these various function prototypes
41 * #include this header directly. These include but are not necessarily
42 * limited to <stdio.h>, <stdio_iso.h>, <wchar_iso.h>, <strlog.h> and
43 * <syslog.h>. The type definitions included in this header are for
44 * the benefit of consumers of va_list.
45 *
46 * Any application that accepts variable argument lists must as documented,
59 * the type __va_alist_type for the variable list pseudo parameter
60 * the type __va_list defining the type of the variable list iterator
61 *
62 * The feature macros (e.g. __BUILTIN_VA_STRUCT) and compiler macros
63 * (__GNUC__) and processor macros (e.g. __amd64) are intended to be
64 * defined by the compilation system, not the user of the system.
65 */
66
67 #include <sys/isa_defs.h> /* sys/isa_defs needed for _LP64. */
68
69 #ifdef __cplusplus
70 extern "C" {
71 #endif
72
73 #if defined(_LP64)
74 #define __va_alist_type long
75 #else
76 #define __va_alist_type int
77 #endif
78
79 #if defined(__STDC__) /* source language is ISO C or C++ */
80
81 #define __va_void(expr) ((void)expr)
82 #define __va_ptr_base void
83
84 #else /* source language is K&R C */
85
86 #define __va_void(expr) expr
87 #define __va_ptr_base char
88
89 #endif /* __STDC__ */
90
91 #if defined(__BUILTIN_VA_STRUCT) && !defined(__lint) /* -------- protocol */
92
93 #if defined(__amd64) /* processor */
94
95 typedef struct __va_list_element {
96 unsigned int __va_gp_offset;
97 unsigned int __va_fp_offset;
98 void *__va_overflow_arg_area;
99 void *__va_reg_sve_area;
100 } __va_list[1];
101
102 /* Other ISA __va_list structures added here under #elif */
103
104 #else /* processor */
105
106 #error("No __va_list structure defined for ISA")
107
108 #endif /* processor */
109
110 #elif (defined(__GNUC__) && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || \
|
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) 1984, 1986, 1987, 1988, 1989 AT&T */
23 /* All Rights Reserved */
24
25
26 /*
27 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
28 *
29 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
30 * Use is subject to license terms.
31 */
32
33 #ifndef _SYS_VA_LIST_H
34 #define _SYS_VA_LIST_H
35
36 /*
37 * An application should not include this header directly. Instead it
38 * should be included only through the inclusion of other Sun headers.
39 *
40 * The purpose of this header is to provide the type definitions for
41 * the va_list argument used by a number of printf and printf like
42 * functions. The headers that define these various function prototypes
43 * #include this header directly. These include but are not necessarily
44 * limited to <stdio.h>, <stdio_iso.h>, <wchar_iso.h>, <strlog.h> and
45 * <syslog.h>. The type definitions included in this header are for
46 * the benefit of consumers of va_list.
47 *
48 * Any application that accepts variable argument lists must as documented,
61 * the type __va_alist_type for the variable list pseudo parameter
62 * the type __va_list defining the type of the variable list iterator
63 *
64 * The feature macros (e.g. __BUILTIN_VA_STRUCT) and compiler macros
65 * (__GNUC__) and processor macros (e.g. __amd64) are intended to be
66 * defined by the compilation system, not the user of the system.
67 */
68
69 #include <sys/isa_defs.h> /* sys/isa_defs needed for _LP64. */
70
71 #ifdef __cplusplus
72 extern "C" {
73 #endif
74
75 #if defined(_LP64)
76 #define __va_alist_type long
77 #else
78 #define __va_alist_type int
79 #endif
80
81 #define __va_void(expr) ((void)expr)
82 #define __va_ptr_base void
83
84 #if defined(__BUILTIN_VA_STRUCT) && !defined(__lint) /* -------- protocol */
85
86 #if defined(__amd64) /* processor */
87
88 typedef struct __va_list_element {
89 unsigned int __va_gp_offset;
90 unsigned int __va_fp_offset;
91 void *__va_overflow_arg_area;
92 void *__va_reg_sve_area;
93 } __va_list[1];
94
95 /* Other ISA __va_list structures added here under #elif */
96
97 #else /* processor */
98
99 #error("No __va_list structure defined for ISA")
100
101 #endif /* processor */
102
103 #elif (defined(__GNUC__) && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || \
|