fix(ansi.h): fixed multi symbol export

supports_ansi_colors has been marked inline to allow its use in multiple translation units
This commit is contained in:
2026-04-07 10:05:05 -04:00
parent b9cd60c35c
commit f75c41317c
2 changed files with 8 additions and 8 deletions

View File

@@ -18,7 +18,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# #
# *********************************************************************** # # *********************************************************************** #
project('libconfig', ['cpp', 'c'], version: 'v2.2.0', default_options: ['cpp_std=c++23'], meson_version: '>=1.5.0') project('libconfig', ['cpp', 'c'], version: 'v2.2.1', default_options: ['cpp_std=c++23'], meson_version: '>=1.5.0')
# Add default visibility for all C++ targets # Add default visibility for all C++ targets
add_project_arguments('-fvisibility=default', language: 'cpp') add_project_arguments('-fvisibility=default', language: 'cpp')

View File

@@ -16,7 +16,7 @@
namespace fourdst::config::utils { namespace fourdst::config::utils {
bool supports_ansi_colors() { inline bool supports_ansi_colors() {
if (std::getenv("NO_COLOR")) return false; if (std::getenv("NO_COLOR")) return false;
if (std::getenv("FORCE_COLOR")) return true; if (std::getenv("FORCE_COLOR")) return true;
@@ -36,7 +36,7 @@ namespace fourdst::config::utils {
#endif #endif
} }
const static bool TERM_COLOR_SUPPORT = supports_ansi_colors(); inline const bool TERM_COLOR_SUPPORT = supports_ansi_colors();
class ANSIColor { class ANSIColor {
public: public:
@@ -54,9 +54,9 @@ namespace fourdst::config::utils {
}; };
static ANSIColor RED{"\033[31m"}; inline ANSIColor RED{"\033[31m"};
static ANSIColor GREEN{"\033[32m"}; inline ANSIColor GREEN{"\033[32m"};
static ANSIColor BLUE{"\033[34m"}; inline ANSIColor BLUE{"\033[34m"};
static ANSIColor CYAN{"\033[36m"}; inline ANSIColor CYAN{"\033[36m"};
static ANSIColor RESET{"\033[0m"}; inline ANSIColor RESET{"\033[0m"};
} }