From f47ed1be51b079d9616b4d93a4181c89f3006d73 Mon Sep 17 00:00:00 2001
From: Ryan Pavlik <rpavlik@iastate.edu>
Date: Fri, 28 Oct 2011 11:59:28 -0500
Subject: FbTk/I18n.cc: Constructor should also check defined(NLS)

---
 src/FbTk/I18n.cc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/FbTk/I18n.cc b/src/FbTk/I18n.cc
index 81ff078..3daa2e9 100644
--- a/src/FbTk/I18n.cc
+++ b/src/FbTk/I18n.cc
@@ -72,17 +72,17 @@ void NLSInit(const char *catalog) {
 
 
 I18n::I18n():m_multibyte(false), m_utf8_translate(false), m_catalog_fd((nl_catd)(-1)) {
-#ifdef 	HAVE_SETLOCALE
+#if defined(HAVE_SETLOCALE) && defined(NLS)
     //make sure we don't get 0 to m_locale string
     char *temp = setlocale(LC_MESSAGES, "");
     m_locale = ( temp ?  temp : "");
     if (m_locale.empty()) {
         cerr<<"Warning: Failed to set locale, reverting to \"C\""<<endl;
-#endif // HAVE_SETLOCALE
+#endif // defined(HAVE_SETLOCALE) && defined(NLS)
 
         m_locale = "C";
 
-#ifdef	HAVE_SETLOCALE
+#if defined(HAVE_SETLOCALE) && defined(NLS)
 
     } else {		
 
@@ -102,7 +102,7 @@ I18n::I18n():m_multibyte(false), m_utf8_translate(false), m_catalog_fd((nl_catd)
         if (index != string::npos) 
             m_locale.erase(0,index+1); //erase all characters starting up to index 
     }
-#endif // HAVE_SETLOCALE
+#endif // defined(HAVE_SETLOCALE) && defined(NLS)
 }
 
 
-- 
cgit v0.11.2