Print this page
remove support for non-ANSI compilation
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/va_list.h
+++ new/usr/src/uts/common/sys/va_list.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
↓ open down ↓ |
16 lines elided |
↑ open up ↑ |
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 22 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
23 23 /* All Rights Reserved */
24 24
25 25
26 26 /*
27 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
28 + *
27 29 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
28 30 * Use is subject to license terms.
29 31 */
30 32
31 33 #ifndef _SYS_VA_LIST_H
32 34 #define _SYS_VA_LIST_H
33 35
34 36 /*
35 37 * An application should not include this header directly. Instead it
36 38 * should be included only through the inclusion of other Sun headers.
37 39 *
38 40 * The purpose of this header is to provide the type definitions for
39 41 * the va_list argument used by a number of printf and printf like
40 42 * functions. The headers that define these various function prototypes
41 43 * #include this header directly. These include but are not necessarily
42 44 * limited to <stdio.h>, <stdio_iso.h>, <wchar_iso.h>, <strlog.h> and
43 45 * <syslog.h>. The type definitions included in this header are for
44 46 * the benefit of consumers of va_list.
45 47 *
46 48 * Any application that accepts variable argument lists must as documented,
47 49 * include either <varargs.h> or the preferred <stdarg.h>. Doing so will
48 50 * pull in the appropriate compiler protocols defined in <sys/va_impl.h>
49 51 * which is in turn is included by <varargs.h> and <stdarg.h>. See comments
50 52 * in <sys/va_impl.h> for more detailed information regarding implementation
51 53 * and compiler specific protocols.
52 54 */
53 55
54 56 /*
55 57 * The common definitions exported by this header or compilers using
56 58 * this header are:
57 59 *
58 60 * the identifier __builtin_va_alist for the variable list pseudo parameter
59 61 * the type __va_alist_type for the variable list pseudo parameter
60 62 * the type __va_list defining the type of the variable list iterator
61 63 *
62 64 * The feature macros (e.g. __BUILTIN_VA_STRUCT) and compiler macros
63 65 * (__GNUC__) and processor macros (e.g. __amd64) are intended to be
64 66 * defined by the compilation system, not the user of the system.
65 67 */
66 68
67 69 #include <sys/isa_defs.h> /* sys/isa_defs needed for _LP64. */
68 70
↓ open down ↓ |
32 lines elided |
↑ open up ↑ |
69 71 #ifdef __cplusplus
70 72 extern "C" {
71 73 #endif
72 74
73 75 #if defined(_LP64)
74 76 #define __va_alist_type long
75 77 #else
76 78 #define __va_alist_type int
77 79 #endif
78 80
79 -#if defined(__STDC__) /* source language is ISO C or C++ */
80 -
81 81 #define __va_void(expr) ((void)expr)
82 82 #define __va_ptr_base void
83 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 84 #if defined(__BUILTIN_VA_STRUCT) && !defined(__lint) /* -------- protocol */
92 85
93 86 #if defined(__amd64) /* processor */
94 87
95 88 typedef struct __va_list_element {
96 89 unsigned int __va_gp_offset;
97 90 unsigned int __va_fp_offset;
98 91 void *__va_overflow_arg_area;
99 92 void *__va_reg_sve_area;
100 93 } __va_list[1];
101 94
102 95 /* Other ISA __va_list structures added here under #elif */
103 96
104 97 #else /* processor */
105 98
106 99 #error("No __va_list structure defined for ISA")
107 100
108 101 #endif /* processor */
109 102
110 103 #elif (defined(__GNUC__) && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || \
111 104 (__GNUC__ >= 3))) && !defined(__lint) /* ---------------- protocol */
112 105
113 106 #define __GNUC_VA_LIST
114 107
115 108 typedef __builtin_va_list __gnuc_va_list;
116 109 /*
117 110 * XX64 This seems unnecessary .. but is needed because vcmn_err is
118 111 * defined with __va_list instead of plain old va_list.
119 112 * Perhaps that should be fixed!
120 113 */
121 114 typedef __builtin_va_list __va_list;
122 115
123 116 #else /* default */ /* ---------------- protocol */
124 117
125 118 typedef __va_ptr_base *__va_list;
126 119
127 120 #endif /* -------------------------------------------------------- protocol */
128 121
129 122 #ifdef __cplusplus
130 123 }
131 124 #endif
132 125
133 126 #endif /* _SYS_VA_LIST_H */
↓ open down ↓ |
33 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX