Welcome to the Builder Academy

Question What Portable Version Is Being Looked For?

More
14 Nov 2026 01:05 - 14 Nov 2026 01:09 #11086 by krell
In structs.h there is a set of type definitions for boolean that looks like this:
Code:
#if !defined(__cplusplus)      /* Anyone know a portable method? */ #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 202311L typedef char bool;    /**< Technically 1 signed byte; vals should only = TRUE or FALSE. */ #endif                  /* C23 and later provide bool as a keyword. */ #endif

What does that mean, portable version? For boolean, or defining C++? I'm assuming boolean.
Last edit: 14 Nov 2026 01:09 by krell.

Please Log in or Create an account to join the conversation.

More
14 Nov 2026 10:35 #11087 by thomas
C did not have a bool type until 202311. The code checks that we are not compiling as c++ (which has one) and that we are in an old version of the stdlib.

Please Log in or Create an account to join the conversation.

Time to create page: 0.209 seconds