Stephane-D / SGDK

SGDK - A free and open development kit for the Sega Mega Drive
https://www.patreon.com/SGDK
MIT License
1.75k stars 187 forks source link

Define bool size as 8 bits instead of 16 #245

Closed Darky-Lucera closed 2 years ago

Darky-Lucera commented 2 years ago

When a user tries to use SGDK with a C++ project #define bool becomes illegal.

By default, m68k GCC defines bool with 8 bits size. If you match this size C++ users would use the library easily without recompiling it. Furthermore, 8 bits to store two values is enough for everyone, and also probably the code could be smaller.

Stephane-D commented 2 years ago

I initially set it to u16 as usually that is the fastest type to use but for boolean operation i think it shouldn't make a big difference, We rarely use bool for arithmetic so that should be fine. Updated bool to u8 now :)