1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore/*
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * CDDL HEADER START
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore *
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * The contents of this file are subject to the terms of the
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * Common Development and Distribution License (the "License").
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * You may not use this file except in compliance with the License.
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore *
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * or http://www.opensolaris.org/os/licensing.
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * See the License for the specific language governing permissions
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * and limitations under the License.
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore *
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * When distributing Covered Code, include this CDDL HEADER in each
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * If applicable, add the following below this CDDL HEADER, with the
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * fields enclosed by brackets "[]" replaced with your own identifying
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * information: Portions Copyright [yyyy] [name of copyright owner]
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore *
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * CDDL HEADER END
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore */
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore/*
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * Use is subject to license terms.
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore */
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore#ifndef _SYS_STDBOOL_H
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore#define _SYS_STDBOOL_H
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore/*
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * This header is included for alignment with the ISO/IEC 9899:1999 standard.
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * The contents are only visible when using a c99 compiler. In the case of
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * the Sun compiler, some C99 features, including the _Bool built-in type,
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * are provided in the default compilation mode. This is a subset of what
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * is provided when __STDC_VERSION__ is 199901; hence the contents of this
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * header are made visible when either __STDC_VERSION__ >= 199901 (_STDC_C99
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * as defined in sys/feature_tests.h) or if __C99FEATURES__ (a Sun compiler
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * built-in) is defined. Likewise for GNU C, support for C99 features,
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * including this header, is provided in versions 3.0 or greater. In no
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * case should the contents of this header be visible in a C++ build
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * environment.
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore *
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * Note that the ability to undefine and redefine the macros bool,
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * true, and false is an obsolescent feature which may be withdrawn
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore * in a future version of the standards specifications.
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore */
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore#include <sys/feature_tests.h>
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore#ifndef __cplusplus
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore#if defined(_STDC_C99) || defined(__C99FEATURES__) || __GNUC__ >= 3
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore#undef bool
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore#undef true
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore#undef false
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore#define bool _Bool
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore#define true 1
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore#define false 0
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore#define __bool_true_false_are_defined 1
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore#endif /* defined(_STDC_C99) || defined(__C99FEATURES__) || __GNUC__ >= 3 */
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore#endif /* __cplusplus */
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore
1de1bbba6d035038f973ba1983f28d1304a35e26Garrett D'Amore#endif /* !_SYS_STDBOOL_H */