From 6a458a381b2103524e00218bd205feaf15a6d767 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Wed, 17 Jun 2009 22:40:14 +0000 Subject: [PATCH] Fix ticket #2986 patch for VC++ 7.1 and earlier; workaround WCHAR_MAX bug [SVN r54031] --- utf8_codecvt_facet.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/utf8_codecvt_facet.cpp b/utf8_codecvt_facet.cpp index 0821c2f..7ea5eeb 100644 --- a/utf8_codecvt_facet.cpp +++ b/utf8_codecvt_facet.cpp @@ -248,8 +248,11 @@ int get_cont_octet_out_count_impl<4>(wchar_t word){ // should be enough to get WCHAR_MAX defined. #if !defined(WCHAR_MAX) # error WCHAR_MAX not defined! -#endif -#if WCHAR_MAX > 0x10000 +#endif + // cope with VC++ 7.1 or earlier having invalid WCHAR_MAX +#if defined(_MSC_VER) && _MSC_VER <= 1310 // 7.1 or earlier + return 2; +#elif WCHAR_MAX > 0x10000 if (word < 0x10000) { return 2;