summaryrefslogtreecommitdiffstats
path: root/external/boost/boost.noiconv.patch
blob: 02f206375a4ae6afa4633042c35715f62fa69a6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
diff -ru boost.orig/boost/libs/locale/src/encoding/codepage.cpp boost/boost/libs/locale/src/encoding/codepage.cpp
--- foo/misc/boost.orig/libs/locale/src/encoding/codepage.cpp
+++ foo/misc/boost/libs/locale/src/boost/locale/encoding/codepage.cpp
@@ -39,6 +39,7 @@
                                     const char* from_charset,
                                     method_type how)
         {
+#if defined(BOOST_LOCALE_WITH_ICONV) || defined(BOOST_LOCALE_WITH_ICU) || defined(BOOST_LOCALE_WITH_WCONV)
             hold_ptr<converter_between> cvt;
 #ifdef BOOST_LOCALE_WITH_ICONV
             cvt.reset(new iconv_between());
@@ -55,6 +56,7 @@
             if(cvt->open(to_charset, from_charset, how))
                 return cvt->convert(begin, end);
 #endif
+#endif
             throw invalid_charset_error(std::string(to_charset) + " or " + from_charset);
         }
 
@@ -65,6 +67,7 @@
         template<typename CharType>
         std::basic_string<CharType> convert_to(const char* begin, const char* end, const char* charset, method_type how)
         {
+#if defined(BOOST_LOCALE_WITH_ICONV) || defined(BOOST_LOCALE_WITH_ICU) || defined(BOOST_LOCALE_WITH_WCONV)
             hold_ptr<converter_to_utf<CharType>> cvt;
 #ifdef BOOST_LOCALE_WITH_ICONV
             cvt.reset(new iconv_to_utf<CharType>());
@@ -81,6 +84,7 @@
             if(cvt->open(charset, how))
                 return cvt->convert(begin, end);
 #endif
+#endif
             throw invalid_charset_error(charset);
         }
 
@@ -91,6 +95,7 @@
         template<typename CharType>
         std::string convert_from(const CharType* begin, const CharType* end, const char* charset, method_type how)
         {
+#if defined(BOOST_LOCALE_WITH_ICONV) || defined(BOOST_LOCALE_WITH_ICU) || defined(BOOST_LOCALE_WITH_WCONV)
             hold_ptr<converter_from_utf<CharType>> cvt;
 #ifdef BOOST_LOCALE_WITH_ICONV
             cvt.reset(new iconv_from_utf<CharType>());
@@ -107,6 +112,7 @@
             if(cvt->open(charset, how))
                 return cvt->convert(begin, end);
 #endif
+#endif
             throw invalid_charset_error(charset);
         }