all repos — fluxbox @ aedcaea054a91f10329377ca776396326d0078fa

custom fork of the fluxbox windowmanager

properly protect usage of iconv_t by HAVE_ICONV
simonb simonb
commit

aedcaea054a91f10329377ca776396326d0078fa

parent

b699ed4d9e4fd99fd894b5d3d2e3767c41ebf80c

2 files changed, 15 insertions(+), 3 deletions(-)

jump to
M src/FbTk/FbString.ccsrc/FbTk/FbString.cc

@@ -231,14 +231,18 @@

}; // 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
M src/FbTk/FbString.hhsrc/FbTk/FbString.hh

@@ -67,12 +67,20 @@ StringConvertor(EncodingTarget target);

~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; };