- 论坛徽章:
- 0
|
用AUTOCONF提供的方法吧:
- /*
- * If stdbool.h exists and conforms to C99, define HAVE_STDBOOL_H to 1;
- * if the type _Bool is defined, define HAVE__BOOL to 1.
- * To fulfill the C99 requirements, your system.h could contain the following code:
- */
- #ifdef HAVE_STDBOOL_H
- # include <stdbool.h>
- #else
- # ifndef HAVE__BOOL
- # ifdef __cplusplus
- typedef bool _Bool;
- # else
- # define _Bool signed char
- # endif
- # endif
- # define bool _Bool
- # define false 0
- # define true 1
- # define __bool_true_false_are_defined 1
- #endif
复制代码 |
|