]> git.lyx.org Git - features.git/commitdiff
FreeBSD libc uses UCS4, but libstdc++ has no proper wchar_t support compiled in ...
authorJosé Matox <jamatos@lyx.org>
Wed, 27 Jun 2007 18:02:54 +0000 (18:02 +0000)
committerJosé Matox <jamatos@lyx.org>
Wed, 27 Jun 2007 18:02:54 +0000 (18:02 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18913 a592a061-630c-0410-9148-cb99ea01b6c8

configure.ac
src/support/docstream.cpp
src/support/docstring.cpp
src/support/docstring.h
src/support/types.h

index d7a8fc7007cff7eba08c9b8f63a257921084b123..3c73eac3b1243552b90d6a43adfa841dc9a9f01d 100644 (file)
@@ -383,8 +383,18 @@ int mkstemp(char*);
 #  define WANT_GETFILEATTRIBUTESEX_WRAPPER 1
 #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
index c2193c8273b9112451dabab06b98f8bb5e8ddcc9..8f476376e6f586ca95be86a84bebad417b76bfdc 100644 (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
 // a bug in gcc. The implementation here does not do anything useful, since
 // it is overriden in iconv_codecvt_facet.
index 35414934168f5a967418ea7aa83e1b428e605e5c..ba424cd2c7adc6a8a46ca89a7e1dab8752c200de 100644 (file)
@@ -217,7 +217,7 @@ lyx::docstring & operator+=(lyx::docstring & l, char r)
 
 } // 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
 // sizeof(wchar_t) == 2, so we have to implement them on our own.
index 6ee612bb3cbf6913b8bd8aabec51733626b16e3b..e974e4ea1fecfb2df65bf46ea6d695262f9baf40 100644 (file)
@@ -98,7 +98,7 @@ lyx::docstring & operator+=(lyx::docstring & l, char r);
 } // 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.
 namespace std {
 
index 446aa3d60f94ee09173ee90093354d00f983f914..6151a676e1752425b4239013ea65c7fc2bb64285 100644 (file)
@@ -23,7 +23,7 @@
 namespace lyx {
 
        /// 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
        // std::ctype<wchar_t> locale facets but not
        // std::ctype<boost::uint32_t>. gcc older than 3.4 is also missing