stdbool.mh
来自「开放源码的编译器open watcom 1.6.0版的源代码」· MH 代码 · 共 39 行
MH
39 行
/***************************************************************************
* FILE: stdbool.h (Macros to simulate the 'bool' type in C)
*
:include crwat.sp
*
* Description: This header is part of the C99 standard library. It
* provides a way for the programmer, at his/her option
* to introduce the type 'bool' into a C program.
***************************************************************************/
#ifndef _STDBOOL_H_INCLUDED
#define _STDBOOL_H_INCLUDED
:include readonly.sp
::
:: To prevent compatibility problems for C++ programs that call C
:: functions using the 'bool' defined here, the sizeof(C++'s bool)
:: should be equal to the sizeof(C's bool defined here). Currently
:: for C++, sizeof(bool) == 1.
::
:: Similarly the values for 'true' and 'false' defined here should
:: be compatible with the values of true and false built into the
:: C++ compiler. That appears to be the case with 1 and 0 (is that
:: a consequence of the C++ standard?)
::
:: C++ programs should use the built in bool type.
#ifndef __cplusplus
#if __STDC_VERSION__ >= 199901L
#define bool _Bool
#else
#define bool char
#endif
#define true 1
#define false 0
#endif
#define __bool_true_false_are_defined 1
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?