Skip to content

Commit 3bbf2d8

Browse files
committed
Use BOOST_IF_CONSTEXPR to avoid warnings
1 parent f59b5a1 commit 3bbf2d8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/test_encoding.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static MacOSIconvIssue isFaultyIconv()
4949
static bool iConvUsesWTF8()
5050
{
5151
// The test uses a 4-byte value
52-
if(sizeof(wchar_t) != 4)
52+
BOOST_IF_CONSTEXPR(sizeof(wchar_t) != 4)
5353
return false;
5454
iconv_t cd = iconv_open("UTF-8", boost::locale::util::utf_name<wchar_t>());
5555
if(cd == (iconv_t)-1)
@@ -395,12 +395,12 @@ void test_utf_for()
395395
}
396396
const auto iconvIssue = isFaultyIconv();
397397
// Testing a codepage which may crash with IConv on macOS, see issue #196
398-
if(iconvIssue != MacOSIconvIssue::InfiniteLoop)
398+
BOOST_IF_CONSTEXPR(iconvIssue != MacOSIconvIssue::InfiniteLoop)
399399
test_to_from_utf<Char>("\xa1\xad\xa1\xad", utf<Char>("……"), "gbk", false);
400400

401401
// This might cause a bogus E2BIG with Apples Iconv, see issue #206
402402
// If it does not it might not have proper ISO-2022-CN support and returns wrong results
403-
if(iconvIssue != MacOSIconvIssue::No_CN_Support)
403+
BOOST_IF_CONSTEXPR(iconvIssue != MacOSIconvIssue::No_CN_Support)
404404
test_to_from_utf<Char>("\x1b\x24\x29\x41\x0e\x4a\x35\xf", utf<Char>(""), "ISO-2022-CN", false);
405405

406406
std::cout << "- Testing correct invalid bytes skipping\n";

0 commit comments

Comments
 (0)