summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordamico <none@none>2006-07-21 06:53:03 -0700
committerdamico <none@none>2006-07-21 06:53:03 -0700
commit805b6c0426f50f44bd56333ddd105576a1e47aa5 (patch)
tree6da0d6750d237ce754de64f5201364e50db5052b
parent8398201ff827e22ff3057fcd8e7977d4d2e2036f (diff)
downloadillumos-joyent-805b6c0426f50f44bd56333ddd105576a1e47aa5.tar.gz
6444826 Contents of stdbool.h should be visible for default C99 cc and gcc compilations
-rw-r--r--usr/src/head/stdbool.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/usr/src/head/stdbool.h b/usr/src/head/stdbool.h
index 7cd5ae7bd0..2d5a08c941 100644
--- a/usr/src/head/stdbool.h
+++ b/usr/src/head/stdbool.h
@@ -30,9 +30,17 @@
#pragma ident "%Z%%M% %I% %E% SMI"
/*
- * Included for alignment with the ISO/IEC 9899:1999 standard. The
- * contents of this header are only visible when using a c99
- * compiler.
+ * This header is included for alignment with the ISO/IEC 9899:1999 standard.
+ * The contents are only visible when using a c99 compiler. In the case of
+ * the Sun compiler, some C99 features, including the _Bool built-in type,
+ * are provided in the default compilation mode. This is a subset of what
+ * is provided when __STDC_VERSION__ is 199901; hence the contents of this
+ * header are made visible when either __STDC_VERSION__ >= 199901 (_STDC_C99
+ * as defined in sys/feature_tests.h) or if __C99FEATURES__ (a Sun compiler
+ * built-in) is defined. Likewise for GNU C, support for C99 features,
+ * including this header, is provided in versions 3.0 or greater. In no
+ * case should the contents of this header be visible in a C++ build
+ * environment.
*
* Note that the ability to undefine and redefine the macros bool,
* true, and false is an obsolescent feature which may be withdrawn
@@ -41,7 +49,8 @@
#include <sys/feature_tests.h>
-#if defined(_STDC_C99)
+#ifndef __cplusplus
+#if defined(_STDC_C99) || defined(__C99FEATURES__) || __GNUC__ >= 3
#undef bool
#undef true
@@ -53,6 +62,7 @@
#define __bool_true_false_are_defined 1
-#endif /* _STDC_C99 */
+#endif /* defined(_STDC_C99) || defined(__C99FEATURES__) || __GNUC__ >= 3 */
+#endif /* __cplusplus */
#endif /* _STDBOOL_H */