5064 ctype.h C++ regression regarding ::isblank
[illumos-gate.git] / usr / src / head / ctype.h
blob213bcb9582c6765b140ecbea8295e6c945ed54da
1 /*
2 * CDDL HEADER START
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.
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.
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]
20 * CDDL HEADER END
22 /* Copyright (c) 1988 AT&T */
23 /* All Rights Reserved */
27 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
28 * Use is subject to license terms.
31 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
34 #ifndef _CTYPE_H
35 #define _CTYPE_H
37 #include <iso/ctype_iso.h>
40 * Allow global visibility for symbols defined in
41 * C++ "std" namespace in <iso/ctype_iso.h>.
43 #if __cplusplus >= 199711L
44 using std::isalnum;
45 using std::isalpha;
46 using std::iscntrl;
47 using std::isdigit;
48 using std::isgraph;
49 using std::islower;
50 using std::isprint;
51 using std::ispunct;
52 using std::isspace;
53 using std::isupper;
54 using std::isxdigit;
55 using std::tolower;
56 using std::toupper;
57 #if (__cplusplus >= 201103L) || defined(_STDC_C99) || defined(_XPG6) || \
58 !defined(_STRICT_SYMBOLS)
59 using std::isblank;
60 #endif
61 #endif
63 #ifdef __cplusplus
64 extern "C" {
65 #endif
67 #if defined(__STDC__)
69 #if defined(__EXTENSIONS__) || \
70 ((!defined(_STRICT_STDC) && !defined(_POSIX_C_SOURCE)) || \
71 defined(_XOPEN_SOURCE))
73 extern int isascii(int);
74 extern int toascii(int);
75 extern int _tolower(int);
76 extern int _toupper(int);
78 #endif /* defined(__EXTENSIONS__) || ((!defined(_STRICT_STDC) ... */
80 #if !defined(__lint)
82 #if defined(__EXTENSIONS__) || \
83 ((!defined(_STRICT_STDC) && !defined(_POSIX_C_SOURCE)) || \
84 defined(_XOPEN_SOURCE)) || defined(__XPG4_CHAR_CLASS__)
85 #define isascii(c) (!(((int)(c)) & ~0177))
86 #define toascii(c) (((int)(c)) & 0177)
87 #define _toupper(c) (toupper(c))
88 #define _tolower(c) (tolower(c))
90 #endif /* defined(__EXTENSIONS__) || ((!defined(_STRICT_STDC) ... */
92 #endif /* !defined(__lint) */
94 #if defined(_XPG7) || !defined(_STRICT_SYMBOLS)
96 #ifndef _LOCALE_T
97 #define _LOCALE_T
98 typedef struct _locale *locale_t;
99 #endif
101 extern int isalnum_l(int, locale_t);
102 extern int isalpha_l(int, locale_t);
103 extern int isblank_l(int, locale_t);
104 extern int iscntrl_l(int, locale_t);
105 extern int isdigit_l(int, locale_t);
106 extern int isgraph_l(int, locale_t);
107 extern int islower_l(int, locale_t);
108 extern int isprint_l(int, locale_t);
109 extern int ispunct_l(int, locale_t);
110 extern int isspace_l(int, locale_t);
111 extern int isupper_l(int, locale_t);
112 extern int isxdigit_l(int, locale_t);
114 #endif /* defined(_XPG7) || !defined(_STRICT_SYMBOLS) */
116 #else /* defined(__STDC__) */
118 #if !defined(__lint)
120 #define isascii(c) (!(((int)(c)) & ~0177))
121 #define _toupper(c) (isascii(c) ? __trans_upper[(int)(c)] : toupper(c))
122 #define _tolower(c) (isascii(c) ? __trans_lower[(int)(c)] : tolower(c))
123 #define toascii(c) (((int)(c)) & 0177)
125 #endif /* !defined(__lint) */
127 #endif /* defined(__STDC__) */
129 #ifdef __cplusplus
131 #endif
133 #endif /* _CTYPE_H */