69,371
社区成员
发帖
与我相关
我的任务
分享
#ifndef STDBOOL_H_
#define STDBOOL_H_
#define bool _BOOL
#define true 1
#define false 0
#endif
#ifndef _STDBOOL_H
#define _STDBOOL_H
#ifndef __cplusplus
#define bool _Bool
#define true 1
#define false 0
#else /* __cplusplus */
/* Supporting <stdbool.h> in C++ is a GCC extension. */
#define _Bool //这里为什么后面没有接着赋值
#define bool bool //为什么是赋相同的值,下面两个同问。
#define false false
#define true true
#endif /* __cplusplus */
/* Signal that all the definitions are present. */
#define __bool_true_false_are_defined 1 //此处是什么意思?__bool_true_false_are_defined是什么意思?
#endif /* stdbool.h */
typedef int BOOL;
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
代码中的英文注释已经说明为什么
define 只是做 等价 替换 不会作任何检查的!