xyzjacky 发表于 2010-4-27 11:57:43

bool类型的定义 求助

请问,我在ICCv7中,使用bool这个类型定义命令,但是编译的时候始终无法通过,我查了下资料,说是缺少一个叫:stdbool.h的头文件,我找到这个头文件后,编译器还是报错,这个原因我就不得而知了,请问有哪位大侠能帮忙看看吗?
我找到的stdbool.h的头文件内容如下:

#ifndef __bool_true_false_are_defined
#define __bool_true_false_are_defined 1

/* program is allowed to contain its own definitions, so ... */
#undef bool
#undef true
#undef false

#if __STDC_VERSION__ < 199901
typedef int _Bool
#endif

#define bool _Bool
#define true 1
#define false 0

#endif

Gorgon_Meducer 发表于 2010-4-27 20:29:14

ICC不支持bool类型,你需要自己定义,定义如下

typedef unsigned char bool;

#define false       (0)
#define true      (!false)
页: [1]
查看完整版本: bool类型的定义 求助