From 9121ec43af44863c96aaedbb8cdc72047f72656a Mon Sep 17 00:00:00 2001 From: fluxgen Date: Tue, 31 Aug 2004 20:27:08 +0000 Subject: checking for have iconv --- src/FbTk/Font.cc | 11 +++++++++-- src/FbTk/Font.hh | 10 +++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/FbTk/Font.cc b/src/FbTk/Font.cc index 774e92a..8ba5a0a 100644 --- a/src/FbTk/Font.cc +++ b/src/FbTk/Font.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -//$Id: Font.cc,v 1.14 2004/08/31 15:26:39 rathnor Exp $ +//$Id: Font.cc,v 1.15 2004/08/31 20:27:08 fluxgen Exp $ #include "StringUtil.hh" @@ -94,6 +94,7 @@ namespace { #include #endif //HAVE_SETLOCALE +#ifdef HAVE_ICONV /** Recodes the text from one encoding to another assuming cd is correct @@ -103,7 +104,7 @@ namespace { @return the recoded string, or 0 on failure */ char* recode(iconv_t cd, - const char *msg, size_t size) { + const char *msg, size_t size) { // If empty message, yes this can happen, return if(strlen(msg) == 0 || size == 0) @@ -140,7 +141,13 @@ char* recode(iconv_t cd, return new_msg_ptr; } +#else +char *recode(iconv_t cd, + const char *msg, size_t size) { + return 0; +} +#endif // HAVE_ICONV int extract_halo_options(const std::string& opts, std::string& color) { std::list< std::string > tokens; diff --git a/src/FbTk/Font.hh b/src/FbTk/Font.hh index d994acf..71d560c 100644 --- a/src/FbTk/Font.hh +++ b/src/FbTk/Font.hh @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -//$Id: Font.hh,v 1.10 2004/08/18 16:30:33 rathnor Exp $ +//$Id: Font.hh,v 1.11 2004/08/31 20:27:08 fluxgen Exp $ #ifndef FBTK_FONT_HH #define FBTK_FONT_HH @@ -30,7 +30,13 @@ #include #include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif // HAVE_CONFIG_H + +#ifdef HAVE_ICONV #include +#endif // HAVE_ICONV namespace FbTk { @@ -111,7 +117,9 @@ private: int m_shadow_offy; ///< offset x for shadow bool m_halo; ///< halo text std::string m_halo_color; ///< halo color +#ifdef HAVE_ICONV iconv_t m_iconv; +#endif // HAVE_ICONV }; } //end namespace FbTk -- cgit v0.11.2