Skip to content
Kay Steinhoff edited this page Oct 7, 2024 · 1 revision

bool

CR tries to find the best solution for booleans using preprocessor statements. I do not garuantee it to work but it is the simplest and best I could come up with to my current knowledge.

#if (__STDC_VERSION__ >= 199901L && __STDC_VERSION__ < 202000L)
        #include <stdbool.h>
#elif __STDC_VERSION__ < 199901L
        typedef unsigned int _Bool;
        #define false ((unsigned int)0)
        #define true ((unsigned int)1)
        #define bool _Bool
#endif

Clone this wiki locally