rmtew / incursion-roguelike

The legendary computer game Incursion: Hall of the Goblin King!
https://incursion-roguelike.net/
Other
7 stars 1 forks source link

Reserved keyword redefinitions #12

Closed HexDecimal closed 2 months ago

HexDecimal commented 2 months ago

I've noticed several macro definitions which are conflicting with standard headers For example:

https://github.com/rmtew/incursion-roguelike/blob/3251c4eedae01424834bff776f4479645f228473/inc/Defines.h#L4638-L4643

#define max will break any instances of std::max because it replaces any occurrence of the world max. This definition will have to be removed. There's also a #define array which breaks std::array for the same reason.

Defines like these will also break headers depending on the order they are included:

https://github.com/rmtew/incursion-roguelike/blob/3251c4eedae01424834bff776f4479645f228473/inc/Base.h#L16-L19

Possibly other issues, there are a lot of them. Errors caused by bad macro definitions will not show the define which is causing the error, making them difficult to trace. I might suggest replacing nearly all definitions with constant expressions to make them easier to debug going forward.

These issues are blocking my attempts to update libtcod, which I need to setup a cross-platform build.