>>>>> "Jean-Marc" == Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes:
[now with the patch!] >>>>> "Peter" == Peter Kümmel <[EMAIL PROTECTED]> writes: Peter> Is it correct that this line remains untouched? Peter> #if SIZEOF_WCHAR_T != 4 && defined(__GNUC__) && Peter> defined(__GNUC_MINOR__) && __GNUC__ == 3 && __GNUC_MINOR__ < 4 Jean-Marc> No, and I do not know how I missed it. I think it should be Jean-Marc> #if ! defined(USE_WCHAR_T) && defined(__GNUC__) && Jean-Marc> defined(__GNUC_MINOR__) && __GNUC__ == 3 && __GNUC_MINOR__ Jean-Marc> < 4 Jose, do I still have time to commit the following patch? I did not add OpenBSD and NetBSD, since I'd rather have first hand reports on what should be done. The best probably would be to contact the port maintainers: http://pkgsrc.se/editors/lyx-qt http://ports.openbsd.nu/print/lyx JMarc
Index: src/support/docstream.cpp =================================================================== --- src/support/docstream.cpp (révision 18908) +++ src/support/docstream.cpp (copie de travail) @@ -322,7 +322,7 @@ odocstream & operator<<(odocstream & os, } -#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: src/support/docstring.cpp =================================================================== --- src/support/docstring.cpp (révision 18908) +++ src/support/docstring.cpp (copie de travail) @@ -217,7 +217,7 @@ lyx::docstring & operator+=(lyx::docstri } // 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: src/support/types.h =================================================================== --- src/support/types.h (révision 18908) +++ src/support/types.h (copie de travail) @@ -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 Index: src/support/docstring.h =================================================================== --- src/support/docstring.h (révision 18908) +++ src/support/docstring.h (copie de travail) @@ -98,7 +98,7 @@ lyx::docstring & operator+=(lyx::docstri } // 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: configure.ac =================================================================== --- configure.ac (révision 18908) +++ configure.ac (copie de travail) @@ -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