restore old fake boolean typedef when no <stdbool.h>

This commit is contained in:
Landon Curt Noll
2023-08-21 04:05:24 -07:00
parent 8c6d2b2e07
commit 6abdd8ef3f
2 changed files with 1 additions and 6 deletions

View File

@@ -45,9 +45,6 @@ The following are the changes from calc version 2.14.3.5 to date:
Fixed have_statfs optional executable file extension ${EXT{ in
the ${UTIL_PROGS} make variable.
Prevented the "fake boolean value" when <stdbool.h> is missing,
from complicating C compilers post c17 standard.
Test if <stdint.h> exists and set HAVE_STDINT_H accordingly
in have_stdint.h. Added HAVE_STDINT_H to allow one to force
this value.

4
bool.h
View File

@@ -42,9 +42,7 @@
#if !defined(HAVE_STDBOOL_H)
/* fake a <stdbool.h> header file */
#if __STDC_VERSION__ <= 201710
typedef unsigned int bool; /* fake boolean typedef */
#endif /* __STDC_VERSION__ <= 201710 */
typedef unsigned char bool; /* fake boolean typedef */
#undef true
#define true ((bool)(1))
#undef false