6aa43d99a3
2002-12-16 Benjamin Kosnik <bkoz@redhat.com> * configure.in (GLIBCPP_ENABLE_DEBUG): Default to none. Call GLIBCPP_ENABLE_DEBUG_FLAGS. * acinclude.m4 (GLIBCPP_ENABLE_DEBUG): GLIBCPP_BUILD_DEBUG, new conditional if --enable-debug is yes. Rework. (GLIBCPP_ENABLE_DEBUG_FLAGS): New. * aclocal.m4: Regenerate. * libio/Makefile.am: Remove DEBUG_FLAGS. * libio/Makefile.in: Regenerate. * libsupc++/Makefile.am: Remove DEBUG_FLAGS. * libsupc++/Makefile.in: Regenerate. * docs/html/configopts.html: Add docs for --enable-debug, --enable-debug-flags. 2002-12-16 Benjamin Kosnik <bkoz@redhat.com> Correct dependency tracking, build warts. * configure.in: Correct repeated AC_OUTPUT thrashing by config-ml.in * configure: Regenerate. * include/Makefile.am (stamp-target): Stamp in top_builddir. * include/Makefile.in: Regenerate. * src/Makefile.am (codecvt_members.cc): New rule. (collate_members.cc): Same. (ctype_members.cc): Same. (messages_members.cc): Same. (monetary_members.cc): Same. (numeric_members.cc): Same. (time_members.cc): Same. (c++locale.cc): Same. (basic_file.cc): Same. * src/Makefile.in: Regenerate. * acinclude.m4 (CCTYPE_CHAR_CC): Remove. (CCCODECVT_CC): Don't link, AC_SUBST. (CCOLLATE_CC): Same. (CCTYPE_CC): Same. (CMESSAGES_CC): Same. (CMONEY_CC): Same. (CNUMERIC_CC): Same. (CTIME_CC): Same. (CLOCALE_CC): Same. * aclocal.m4: Regenerate. * src/Makefile.am (libstdc___la_LIBADD): Use top_builddir for convenience libraries. (version_arg): Rename linker.map to libstdc++.ver. (libstdc___la_DEPENDENCIES): Remove linker.map, add libstdc++-symbol.ver as a dependency. (libstdc++-symbol.ver): Add rule. * acinclude.m4 (GLIBCPP_ENABLE_SYMVERS): Change LINKER_MAP to SYMVER_MAP. Don't link, AC_SUBST. * include/Makefile.am (target_headers_noinst): New. (stamp-target): Add CLOCALE_INTERNAL_H. * acinclude.m4 (GLIBCPP_ENABLE_CLOCALE): Don't link CLOCALE_INTERNAL_H, AC_SUBST. * config/locale/gnu/c_locale.cc: Modify c++locale_internal.h include. * config/locale/gnu/time_members.cc: Same. * config/locale/gnu/numeric_members.cc: Same. * config/locale/gnu/monetary_members.cc: Same. * config/locale/gnu/messages_members.cc: Same. * config/locale/gnu/ctype_members.cc: Same. * config/locale/gnu/collate_members.cc: Same. * config/locale/gnu/codecvt_members.cc: Same. * config/locale/generic/codecvt_members.cc: Remove. From-SVN: r60177
82 lines
2.9 KiB
C++
82 lines
2.9 KiB
C++
// std::messages implementation details, GNU version -*- C++ -*-
|
|
|
|
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
|
|
//
|
|
// This file is part of the GNU ISO C++ Library. This library is free
|
|
// software; you can redistribute it and/or modify it under the
|
|
// terms of the GNU General Public License as published by the
|
|
// Free Software Foundation; either version 2, or (at your option)
|
|
// any later version.
|
|
|
|
// This library is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
|
|
// You should have received a copy of the GNU General Public License along
|
|
// with this library; see the file COPYING. If not, write to the Free
|
|
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
// USA.
|
|
|
|
// As a special exception, you may use this file as part of a free software
|
|
// library without restriction. Specifically, if other files instantiate
|
|
// templates or use macros or inline functions from this file, or you compile
|
|
// this file and link it with other files to produce an executable, this
|
|
// file does not by itself cause the resulting executable to be covered by
|
|
// the GNU General Public License. This exception does not however
|
|
// invalidate any other reasons why the executable file might be covered by
|
|
// the GNU General Public License.
|
|
|
|
//
|
|
// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
|
|
//
|
|
|
|
// Written by Benjamin Kosnik <bkoz@redhat.com>
|
|
|
|
#include <locale>
|
|
#include <bits/c++locale_internal.h>
|
|
|
|
namespace std
|
|
{
|
|
// Specializations.
|
|
template<>
|
|
string
|
|
messages<char>::do_get(catalog, int, int, const string& __dfault) const
|
|
{
|
|
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
|
__c_locale __old = __uselocale(_M_c_locale_messages);
|
|
const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
|
|
__uselocale(__old);
|
|
return string(__msg);
|
|
#else
|
|
char* __old = strdup(setlocale(LC_ALL, NULL));
|
|
setlocale(LC_ALL, _M_name_messages);
|
|
const char* __msg = gettext(__dfault.c_str());
|
|
setlocale(LC_ALL, __old);
|
|
free(__old);
|
|
return string(__msg);
|
|
#endif
|
|
}
|
|
|
|
#ifdef _GLIBCPP_USE_WCHAR_T
|
|
template<>
|
|
wstring
|
|
messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
|
|
{
|
|
# if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
|
__c_locale __old = __uselocale(_M_c_locale_messages);
|
|
char* __msg = gettext(_M_convert_to_char(__dfault));
|
|
__uselocale(__old);
|
|
return _M_convert_from_char(__msg);
|
|
# else
|
|
char* __old = strdup(setlocale(LC_ALL, NULL));
|
|
setlocale(LC_ALL, _M_name_messages);
|
|
char* __msg = gettext(_M_convert_to_char(__dfault));
|
|
setlocale(LC_ALL, __old);
|
|
free(__old);
|
|
return _M_convert_from_char(__msg);
|
|
# endif
|
|
}
|
|
#endif
|
|
}
|