jgabaut / helapordo

A roguelike terminal game, using ncurses.
https://jgabaut.github.io/helapordo-docs
GNU General Public License v3.0
14 stars 0 forks source link

[BUG] Current check for reset_color_pairs() availability is bogus #95

Closed jgabaut closed 4 months ago

jgabaut commented 4 months ago

As of 1.4.8, this check is used to avoid build failures when building with a ncurses library that does not support reset_color_pairs() extension:

#ifndef reset_color_pairs

Which does not have the intended result at all, since the preprocessor can't be used for this kind of checks.

It may only check for a macro definition, and it seems ncurses does not provide one to identify the availability of this extension.

Thus, the only solution to me seems adding a new build conditional that handles the definition of our own macro to use in the #ifndef.

#ifndef HELAPORDO_SUPPORT_DEFAULT_BACKGROUND

The setting should probably be not enabled by default.

jgabaut commented 4 months ago

Version 1.4.9 added --enable-default-background option for ./configure, to define HELAPORDO_SUPPORT_DEFAULT_BACKGROUND at build time and enable this support.