Bo Peng wrote:
>> According to http://www.netbsd.org/about/roadmap.html, this is also
>> true for NetBSD, so I would also add "&& !defined(__NetBSD__)" there.
> 
> Are you sure about the name here? Not __NETBSD__?
> 
> Bo
> 

Seems he is right:
http://predef.sourceforge.net/preos.html#sec23

And the patch.

Peter
Index: src/support/docstream.cpp
===================================================================
--- src/support/docstream.cpp   (revision 18898)
+++ src/support/docstream.cpp   (working copy)
@@ -322,7 +322,7 @@
 
 }
 
-#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   (revision 18898)
+++ src/support/docstring.cpp   (working copy)
@@ -217,7 +217,7 @@
 
 } // 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 (revision 18898)
+++ src/support/types.h (working copy)
@@ -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: configure.ac
===================================================================
--- configure.ac        (revision 18898)
+++ configure.ac        (working copy)
@@ -383,8 +383,18 @@
 #  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__)  && 
!defined(__NetBSD__)
+#  define USE_WCHAR_T
 #endif
 
 #endif
Index: development/cmake/config.h.cmake
===================================================================
--- development/cmake/config.h.cmake    (revision 18899)
+++ development/cmake/config.h.cmake    (working copy)
@@ -171,7 +171,7 @@
  * 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__)
+#if defined(HAVE_WCHAR_T) && SIZEOF_WCHAR_T == 4 && !defined(__FREEBSD__) && 
!defined(__NetBSD__)
 #  define USE_WCHAR_T
 #endif
 
Index: development/scons/SConstruct
===================================================================
--- development/scons/SConstruct        (revision 18898)
+++ development/scons/SConstruct        (working copy)
@@ -824,8 +824,8 @@
  * 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 LIBC_WCTYPE_USES_UCS4
+#if defined(HAVE_WCHAR_T) && SIZEOF_WCHAR_T == 4 && !defined(__FREEBSD__) && 
!defined(__NetBSD__)
+#  define USE_WCHAR_T
 #endif
 
 #endif

Reply via email to