From aedcaea054a91f10329377ca776396326d0078fa Mon Sep 17 00:00:00 2001 From: simonb <simonb> Date: Mon, 26 Jun 2006 01:36:27 +0000 Subject: properly protect usage of iconv_t by HAVE_ICONV --- src/FbTk/FbString.cc | 8 ++++++-- src/FbTk/FbString.hh | 10 +++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/FbTk/FbString.cc b/src/FbTk/FbString.cc index 3ed1c70..d3f6b81 100644 --- a/src/FbTk/FbString.cc +++ b/src/FbTk/FbString.cc @@ -231,14 +231,18 @@ bool haveUTF8() { }; // end namespace StringUtil -StringConvertor::StringConvertor(EncodingTarget target): m_iconv((iconv_t)(-1)) { +StringConvertor::StringConvertor(EncodingTarget target): #ifdef HAVE_ICONV + m_iconv((iconv_t)(-1)) { if (target == ToLocaleStr) m_destencoding = FbStringUtil::locale_codeset; else m_destencoding = "UTF-8"; -#endif } +#else + m_iconv(-1) {} +#endif + StringConvertor::~StringConvertor() { #ifdef HAVE_ICONV diff --git a/src/FbTk/FbString.hh b/src/FbTk/FbString.hh index 502290b..133945b 100644 --- a/src/FbTk/FbString.hh +++ b/src/FbTk/FbString.hh @@ -67,12 +67,20 @@ public: ~StringConvertor(); bool setSource(const std::string &encoding); - void reset() { m_iconv = ((iconv_t)(-1)); } + void reset() { +#ifdef HAVE_ICONV + m_iconv = ((iconv_t)(-1)); +#endif + } std::string recode(const std::string &src); private: +#ifdef HAVE_ICONV iconv_t m_iconv; +#else + int m_iconv; +#endif std::string m_destencoding; }; -- cgit v0.11.2