FreeBSD libc uses UCS4, but libstdc++ has no proper wchar_t support compiled in (Jean-Marc)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18913 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
José Matox 2007-06-27 18:02:54 +00:00
parent d8dbaf3558
commit 5cbe5cf5ad
5 changed files with 16 additions and 6 deletions

View File

@ -383,8 +383,18 @@ int mkstemp(char*);
# define WANT_GETFILEATTRIBUTESEX_WRAPPER 1 # define WANT_GETFILEATTRIBUTESEX_WRAPPER 1
#endif #endif
#if defined(HAVE_WCHAR_T) && SIZEOF_WCHAR_T == 4 /*
# define LIBC_WCTYPE_USES_UCS4 * the FreeBSD libc uses UCS4, but libstdc++ has no proper wchar_t
* support compiled in:
* http://gcc.gnu.org/onlinedocs/libstdc++/faq/index.html#3_9
* And we are not interested at all what libc
* does: What we need is a 32bit wide wchar_t, and a libstdc++ that
* has the needed wchar_t support and uses UCS4. Whether it
* implements this with the help of libc, or whether it has own code
* does not matter for us, because we don't use libc directly (Georg)
*/
#if defined(HAVE_WCHAR_T) && SIZEOF_WCHAR_T == 4 && ! defined(__FREEBSD__)
# define USE_WCHAR_T
#endif #endif
#endif #endif

View File

@ -322,7 +322,7 @@ odocstream & operator<<(odocstream & os, SetEnc e)
} }
#if (!defined(HAVE_WCHAR_T) || SIZEOF_WCHAR_T != 4) && defined(__GNUC__) #if ! defined(USE_WCHAR_T) && defined(__GNUC__)
// We get undefined references to these virtual methods. This looks like // We get undefined references to these virtual methods. This looks like
// a bug in gcc. The implementation here does not do anything useful, since // a bug in gcc. The implementation here does not do anything useful, since
// it is overriden in iconv_codecvt_facet. // it is overriden in iconv_codecvt_facet.

View File

@ -217,7 +217,7 @@ lyx::docstring & operator+=(lyx::docstring & l, char r)
} // namespace lyx } // namespace lyx
#if (!defined(HAVE_WCHAR_T) || SIZEOF_WCHAR_T != 4) && defined(__GNUC__) #if ! defined(USE_WCHAR_T) && defined(__GNUC__)
// gcc does not have proper locale facets for lyx::char_type if // gcc does not have proper locale facets for lyx::char_type if
// sizeof(wchar_t) == 2, so we have to implement them on our own. // sizeof(wchar_t) == 2, so we have to implement them on our own.

View File

@ -98,7 +98,7 @@ lyx::docstring & operator+=(lyx::docstring & l, char r);
} // namespace lyx } // namespace lyx
#if SIZEOF_WCHAR_T != 4 && defined(__GNUC__) && defined(__GNUC_MINOR__) && __GNUC__ == 3 && __GNUC_MINOR__ < 4 #if ! defined(USE_WCHAR_T) && defined(__GNUC__) && defined(__GNUC_MINOR__) && __GNUC__ == 3 && __GNUC_MINOR__ < 4
// Missing char_traits methods in gcc 3.3 and older. Taken from gcc 4.2svn. // Missing char_traits methods in gcc 3.3 and older. Taken from gcc 4.2svn.
namespace std { namespace std {

View File

@ -23,7 +23,7 @@
namespace lyx { namespace lyx {
/// The type used to hold characters in paragraphs /// The type used to hold characters in paragraphs
#if defined(HAVE_WCHAR_T) && SIZEOF_WCHAR_T == 4 #ifdef USE_WCHAR_T
// Prefer this if possible because GNU libstdc++ has usable // Prefer this if possible because GNU libstdc++ has usable
// std::ctype<wchar_t> locale facets but not // std::ctype<wchar_t> locale facets but not
// std::ctype<boost::uint32_t>. gcc older than 3.4 is also missing // std::ctype<boost::uint32_t>. gcc older than 3.4 is also missing