Print this page
2964 need POSIX 2008 locale object support (more C++ fixes)
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/head/ctype.h
+++ new/usr/src/head/ctype.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
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) 1988 AT&T */
23 23 /* All Rights Reserved */
24 24
25 25
26 26 /*
27 27 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
28 28 * Use is subject to license terms.
29 29 */
30 30 /*
31 31 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
32 32 */
33 33
34 34 #ifndef _CTYPE_H
35 35 #define _CTYPE_H
36 36
37 37 #include <iso/ctype_iso.h>
38 38
39 39 /*
40 40 * Allow global visibility for symbols defined in
41 41 * C++ "std" namespace in <iso/ctype_iso.h>.
42 42 */
43 43 #if __cplusplus >= 199711L
44 44 using std::isalnum;
45 45 using std::isalpha;
46 46 using std::iscntrl;
47 47 using std::isdigit;
48 48 using std::isgraph;
49 49 using std::islower;
50 50 using std::isprint;
51 51 using std::ispunct;
52 52 using std::isspace;
53 53 using std::isupper;
54 54 using std::isxdigit;
55 55 using std::tolower;
56 56 using std::toupper;
57 57 #if _cplusplus >= 201103L
58 58 using std::isblank;
59 59 #endif
60 60 #endif
61 61
62 62 #ifdef __cplusplus
63 63 extern "C" {
64 64 #endif
65 65
66 66 #if defined(__STDC__)
67 67
68 68 #if defined(__EXTENSIONS__) || \
69 69 ((!defined(_STRICT_STDC) && !defined(_POSIX_C_SOURCE)) || \
70 70 defined(_XOPEN_SOURCE))
71 71
72 72 extern int isascii(int);
73 73 extern int toascii(int);
74 74 extern int _tolower(int);
75 75 extern int _toupper(int);
76 76
77 77 #endif /* defined(__EXTENSIONS__) || ((!defined(_STRICT_STDC) ... */
78 78
79 79 #if !defined(__lint)
80 80
81 81 #if defined(__EXTENSIONS__) || \
82 82 ((!defined(_STRICT_STDC) && !defined(_POSIX_C_SOURCE)) || \
83 83 defined(_XOPEN_SOURCE)) || defined(__XPG4_CHAR_CLASS__)
84 84 #define isascii(c) (!(((int)(c)) & ~0177))
85 85 #define toascii(c) (((int)(c)) & 0177)
86 86 #define _toupper(c) (toupper(c))
|
↓ open down ↓ |
86 lines elided |
↑ open up ↑ |
87 87 #define _tolower(c) (tolower(c))
88 88
89 89 #endif /* defined(__EXTENSIONS__) || ((!defined(_STRICT_STDC) ... */
90 90
91 91 #endif /* !defined(__lint) */
92 92
93 93 #if defined(_XPG7) || !defined(_STRICT_SYMBOLS)
94 94
95 95 #ifndef _LOCALE_T
96 96 #define _LOCALE_T
97 -typedef struct locale *locale_t;
97 +typedef struct _locale *locale_t;
98 98 #endif
99 99
100 100 extern int isalnum_l(int, locale_t);
101 101 extern int isalpha_l(int, locale_t);
102 102 extern int isblank_l(int, locale_t);
103 103 extern int iscntrl_l(int, locale_t);
104 104 extern int isdigit_l(int, locale_t);
105 105 extern int isgraph_l(int, locale_t);
106 106 extern int islower_l(int, locale_t);
107 107 extern int isprint_l(int, locale_t);
108 108 extern int ispunct_l(int, locale_t);
109 109 extern int isspace_l(int, locale_t);
110 110 extern int isupper_l(int, locale_t);
111 111 extern int isxdigit_l(int, locale_t);
112 112
113 113 #endif /* defined(_XPG7) || !defined(_STRICT_SYMBOLS) */
114 114
115 115 #else /* defined(__STDC__) */
116 116
117 117 #if !defined(__lint)
118 118
119 119 #define isascii(c) (!(((int)(c)) & ~0177))
120 120 #define _toupper(c) (isascii(c) ? __trans_upper[(int)(c)] : toupper(c))
121 121 #define _tolower(c) (isascii(c) ? __trans_lower[(int)(c)] : tolower(c))
122 122 #define toascii(c) (((int)(c)) & 0177)
123 123
124 124 #endif /* !defined(__lint) */
125 125
126 126 #endif /* defined(__STDC__) */
127 127
128 128 #ifdef __cplusplus
129 129 }
130 130 #endif
131 131
132 132 #endif /* _CTYPE_H */
|
↓ open down ↓ |
25 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX