1 // 2 // Copyright (c) 2009-2011 Artyom Beilis (Tonkikh) 3 // 4 // Distributed under the Boost Software License, Version 1.0. (See 5 // accompanying file LICENSE_1_0.txt or copy at 6 // http://www.boost.org/LICENSE_1_0.txt) 7 // 8 9 #ifndef BOOST_LOCLAE_TEST_LOCALE_POSIX_TOOLS_HPP 10 #define BOOST_LOCLAE_TEST_LOCALE_POSIX_TOOLS_HPP 11 12 #include <locale.h> 13 #include <string> 14 15 #if defined(__APPLE__) || defined(__FreeBSD__) 16 #include <xlocale.h> 17 #endif 18 have_locale(std::string const & name)19inline bool have_locale(std::string const &name) 20 { 21 locale_t l=newlocale(LC_ALL_MASK,name.c_str(),0); 22 if(l) { 23 freelocale(l); 24 return true; 25 } 26 return false; 27 } 28 29 #endif 30 // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 31 32