Skip to content

Commit

Permalink
(#22240) boost 1.83.0: fix windows without NOMINMAX
Browse files Browse the repository at this point in the history
  • Loading branch information
ericLemanissier authored Jan 11, 2024
1 parent e712a50 commit 1c560e3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions recipes/boost/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ patches:
- patch_file: "patches/1.82.0-locale-iconv-library-option.patch"
patch_description: "Optional flag to specify iconv from either libc of libiconv"
patch_type: "conan"
- patch_file: "patches/1.83.0-locale-msvc.patch"
patch_description: "Fix compilation on windows when NOMINMAX is not defined"
patch_type: "official"
patch_source: "https://github.com/boostorg/locale/pull/189"
"1.82.0":
- patch_file: "patches/1.82.0-locale-iconv-library-option.patch"
patch_description: "Optional flag to specify iconv from either libc of libiconv"
Expand Down
22 changes: 22 additions & 0 deletions recipes/boost/all/patches/1.83.0-locale-msvc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
From 0552ffc29ff11e4fe130b7143ea6ac2bee7b15c6 Mon Sep 17 00:00:00 2001
From: wevsty <ty@wevs.org>
Date: Sat, 12 Aug 2023 22:13:48 +0800
Subject: [PATCH] fix build error on MSVC

---
boost/locale/util/string.hpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/boost/locale/util/string.hpp b/boost/locale/util/string.hpp
index 9ab9521c..ba066bd4 100644
--- a/boost/locale/util/string.hpp
+++ b/boost/locale/util/string.hpp
@@ -38,7 +38,7 @@ namespace boost { namespace locale { namespace util {
/// Cast an unsigned char to a (possibly signed) char avoiding implementation defined behavior
constexpr char to_char(unsigned char c)
{
- return static_cast<char>((c - std::numeric_limits<char>::min()) + std::numeric_limits<char>::min());
+ return static_cast<char>((c - (std::numeric_limits<char>::min)()) + (std::numeric_limits<char>::min)());
}

}}} // namespace boost::locale::util

0 comments on commit 1c560e3

Please sign in to comment.