xref: /onnv-gate/usr/src/uts/common/sys/stdbool.h (revision 10333:818ccd4c7d55)
1*10333SGarrett.Damore@Sun.COM /*
2*10333SGarrett.Damore@Sun.COM  * CDDL HEADER START
3*10333SGarrett.Damore@Sun.COM  *
4*10333SGarrett.Damore@Sun.COM  * The contents of this file are subject to the terms of the
5*10333SGarrett.Damore@Sun.COM  * Common Development and Distribution License (the "License").
6*10333SGarrett.Damore@Sun.COM  * You may not use this file except in compliance with the License.
7*10333SGarrett.Damore@Sun.COM  *
8*10333SGarrett.Damore@Sun.COM  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*10333SGarrett.Damore@Sun.COM  * or http://www.opensolaris.org/os/licensing.
10*10333SGarrett.Damore@Sun.COM  * See the License for the specific language governing permissions
11*10333SGarrett.Damore@Sun.COM  * and limitations under the License.
12*10333SGarrett.Damore@Sun.COM  *
13*10333SGarrett.Damore@Sun.COM  * When distributing Covered Code, include this CDDL HEADER in each
14*10333SGarrett.Damore@Sun.COM  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*10333SGarrett.Damore@Sun.COM  * If applicable, add the following below this CDDL HEADER, with the
16*10333SGarrett.Damore@Sun.COM  * fields enclosed by brackets "[]" replaced with your own identifying
17*10333SGarrett.Damore@Sun.COM  * information: Portions Copyright [yyyy] [name of copyright owner]
18*10333SGarrett.Damore@Sun.COM  *
19*10333SGarrett.Damore@Sun.COM  * CDDL HEADER END
20*10333SGarrett.Damore@Sun.COM  */
21*10333SGarrett.Damore@Sun.COM 
22*10333SGarrett.Damore@Sun.COM /*
23*10333SGarrett.Damore@Sun.COM  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24*10333SGarrett.Damore@Sun.COM  * Use is subject to license terms.
25*10333SGarrett.Damore@Sun.COM  */
26*10333SGarrett.Damore@Sun.COM 
27*10333SGarrett.Damore@Sun.COM #ifndef _SYS_STDBOOL_H
28*10333SGarrett.Damore@Sun.COM #define	_SYS_STDBOOL_H
29*10333SGarrett.Damore@Sun.COM 
30*10333SGarrett.Damore@Sun.COM /*
31*10333SGarrett.Damore@Sun.COM  * This header is included for alignment with the ISO/IEC 9899:1999 standard.
32*10333SGarrett.Damore@Sun.COM  * The contents are only visible when using a c99 compiler. In the case of
33*10333SGarrett.Damore@Sun.COM  * the Sun compiler, some C99 features, including the _Bool built-in type,
34*10333SGarrett.Damore@Sun.COM  * are provided in the default compilation mode. This is a subset of what
35*10333SGarrett.Damore@Sun.COM  * is provided when __STDC_VERSION__ is 199901; hence the contents of this
36*10333SGarrett.Damore@Sun.COM  * header are made visible when either __STDC_VERSION__ >= 199901 (_STDC_C99
37*10333SGarrett.Damore@Sun.COM  * as defined in sys/feature_tests.h) or if __C99FEATURES__ (a Sun compiler
38*10333SGarrett.Damore@Sun.COM  * built-in) is defined. Likewise for GNU C, support for C99 features,
39*10333SGarrett.Damore@Sun.COM  * including this header, is provided in versions 3.0 or greater. In no
40*10333SGarrett.Damore@Sun.COM  * case should the contents of this header be visible in a C++ build
41*10333SGarrett.Damore@Sun.COM  * environment.
42*10333SGarrett.Damore@Sun.COM  *
43*10333SGarrett.Damore@Sun.COM  * Note that the ability to undefine and redefine the macros bool,
44*10333SGarrett.Damore@Sun.COM  * true, and false  is an obsolescent feature which may be withdrawn
45*10333SGarrett.Damore@Sun.COM  * in a future version of the standards specifications.
46*10333SGarrett.Damore@Sun.COM  */
47*10333SGarrett.Damore@Sun.COM 
48*10333SGarrett.Damore@Sun.COM #include <sys/feature_tests.h>
49*10333SGarrett.Damore@Sun.COM 
50*10333SGarrett.Damore@Sun.COM #ifndef __cplusplus
51*10333SGarrett.Damore@Sun.COM #if defined(_STDC_C99) || defined(__C99FEATURES__) || __GNUC__ >= 3
52*10333SGarrett.Damore@Sun.COM 
53*10333SGarrett.Damore@Sun.COM #undef	bool
54*10333SGarrett.Damore@Sun.COM #undef	true
55*10333SGarrett.Damore@Sun.COM #undef	false
56*10333SGarrett.Damore@Sun.COM 
57*10333SGarrett.Damore@Sun.COM #define	bool	_Bool
58*10333SGarrett.Damore@Sun.COM #define	true	1
59*10333SGarrett.Damore@Sun.COM #define	false	0
60*10333SGarrett.Damore@Sun.COM 
61*10333SGarrett.Damore@Sun.COM #define	__bool_true_false_are_defined	1
62*10333SGarrett.Damore@Sun.COM 
63*10333SGarrett.Damore@Sun.COM #endif /* defined(_STDC_C99) || defined(__C99FEATURES__) || __GNUC__ >= 3 */
64*10333SGarrett.Damore@Sun.COM #endif /* __cplusplus */
65*10333SGarrett.Damore@Sun.COM 
66*10333SGarrett.Damore@Sun.COM #endif /* !_SYS_STDBOOL_H */
67