From ae54437e9184e737b71e18b1f7551cdc669c0c50 Mon Sep 17 00:00:00 2001 From: Oscar Cowdery Lack Date: Mon, 6 Mar 2023 11:45:12 +1100 Subject: [PATCH] fix: compat with boost 1.81 Boost 1.81 changes various constants in boost::locale to enums which is a breaking change, so we need separate code for each version. --- src/protocol/amcp/AMCPCommandsImpl.cpp | 4 ++++ src/shell/main.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/protocol/amcp/AMCPCommandsImpl.cpp b/src/protocol/amcp/AMCPCommandsImpl.cpp index 62654527c1..40be8cd8fa 100644 --- a/src/protocol/amcp/AMCPCommandsImpl.cpp +++ b/src/protocol/amcp/AMCPCommandsImpl.cpp @@ -124,7 +124,11 @@ std::wstring read_latin1_file(const boost::filesystem::path& file) { boost::locale::generator gen; gen.locale_cache_enabled(true); +#if BOOST_VERSION >= 108100 + gen.categories(boost::locale::category_t::codepage); +#else gen.categories(boost::locale::codepage_facet); +#endif std::stringstream result_stream; boost::filesystem::ifstream filestream(file); diff --git a/src/shell/main.cpp b/src/shell/main.cpp index d12ab3fb1f..4e45df45f9 100644 --- a/src/shell/main.cpp +++ b/src/shell/main.cpp @@ -62,7 +62,11 @@ namespace caspar { void setup_global_locale() { boost::locale::generator gen; +#if BOOST_VERSION >= 108100 + gen.categories(boost::locale::category_t::codepage); +#else gen.categories(boost::locale::codepage_facet); +#endif std::locale::global(gen(""));