On Wed, Sep 13, 2006 at 09:51:33PM +0200, Georg Baum wrote: > Am Mittwoch, 13. September 2006 18:24 schrieb Enrico Forestieri: > > I have installed STLport and the above program still says "size: 2", so > > I think that it "has to be" that way on windows. > > Well, the STL can't change the size of builtin types, so that is expected. > wchar_t does not "have to be" 2 byte wide on windows, but it is what > native windows compilers usually do. On cygwin you have to make a choice > whether to follow other windows compilers or unix. I would not be > surprised if the opposite switch to -fshort-wchar would exist on cygwin.
I'm afraid this doesn't seem to be the case. I investigated a bit and it seems that the wide character support is a newlib issue rather than a cygwin one proper (newlib is to cygwin as glibc is to linux). > > As regards the usable char_traits and friends, if you can provide me > > a test program I can try compiling it using STLport and report back > > the results. > > Try this one. On linux the output is: > > global has std::codecvt<boost::uint32_t> facet: 0 > global has std::ctype<boost::uint32_t> facet: 0 > global has std::num_put<boost::uint32_t> facet: 0 > terminate called after throwing an instance of 'std::bad_cast' > what(): St8bad_cast > Abgebrochen I get the exact same result both on solaris and cygwin without stlport. When using stlport the source doesn't even compile (see attached). I fear this the end of LyX on Cygwin. Now I also have a useless Qt4/Cygwin library :( What really bothers me is that MSVC can do it but not GCC. -- Enrico
$ g++ -Iboost -I/usr/local/include/stlport locale-test.cpp -o locale-test -L/usr/local/lib -lstlport /usr/local/include/stlport/stl/_locale.h: In function `bool stlpmtx_std::has_facet(const stlpmtx_std::locale&) [with _Facet = stlpmtx_std::ctype<uint32_t>]': locale-test.cpp:12: instantiated from here /usr/local/include/stlport/stl/_locale.h:302: error: `id' is not a member of `stlpmtx_std::ctype<uint32_t>' /usr/local/include/stlport/stl/_ios.h: In member function `_CharT stlpmtx_std::basic_ios<_CharT, _Traits>::widen(char) const [with _CharT = uint32_t, _Traits = stlpmtx_std::char_traits<uint32_t>]': /usr/local/include/stlport/stl/_ostream.h:281: instantiated from `stlpmtx_std::basic_ostream<_CharT, _Traits>& stlpmtx_std::operator<<(stlpmtx_std::basic_ostream<_CharT, _Traits>&, char) [with _CharT = uint32_t, _Traits = stlpmtx_std::char_traits<uint32_t>]' locale-test.cpp:16: instantiated from here /usr/local/include/stlport/stl/_ios.h:142: error: invalid static_cast from type `const stlpmtx_std::locale::facet*' to type `const stlpmtx_std::ctype<uint32_t>*' /usr/local/include/stlport/stl/_ios.c: In member function `stlpmtx_std::locale stlpmtx_std::basic_ios<_CharT, _Traits>::imbue(const stlpmtx_std::locale&) [with _CharT = uint32_t, _Traits = stlpmtx_std::char_traits<uint32_t>]': /usr/local/include/stlport/stl/_ios.c:101: instantiated from `void stlpmtx_std::basic_ios<_CharT, _Traits>::init(stlpmtx_std::basic_streambuf<_CharT, _Traits>*) [with _CharT = uint32_t, _Traits = stlpmtx_std::char_traits<uint32_t>]' /usr/local/include/stlport/stl/_sstream.c:490: instantiated from `stlpmtx_std::basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(int) [with _CharT = uint32_t, _Traits = stlpmtx_std::char_traits<uint32_t>, _Alloc = stlpmtx_std::allocator<uint32_t>]' locale-test.cpp:15: instantiated from here /usr/local/include/stlport/stl/_ios.c:75: error: `id' is not a member of `stlpmtx_std::ctype<uint32_t>' /usr/local/include/stlport/stl/_ios.c:101: instantiated from `void stlpmtx_std::basic_ios<_CharT, _Traits>::init(stlpmtx_std::basic_streambuf<_CharT, _Traits>*) [with _CharT = uint32_t, _Traits = stlpmtx_std::char_traits<uint32_t>]' /usr/local/include/stlport/stl/_sstream.c:490: instantiated from `stlpmtx_std::basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(int) [with _CharT = uint32_t, _Traits = stlpmtx_std::char_traits<uint32_t>, _Alloc = stlpmtx_std::allocator<uint32_t>]' locale-test.cpp:15: instantiated from here /usr/local/include/stlport/stl/_ios.c:76: error: `id' is not a member of `stlpmtx_std::numpunct<uint32_t>' /usr/local/include/stlport/stl/_ios.c:77: error: 'class stlpmtx_std::numpunct<uint32_t>' has no member named 'grouping' /usr/local/include/stlport/stl/_num_put.c: In member function `_OutputIter stlpmtx_std::num_put<_CharT, _OutputIter>::do_put(_OutputIter, stlpmtx_std::ios_base&, _CharT, long int) const [with _CharT = uint32_t, _OutputIter = stlpmtx_std::ostreambuf_iterator<uint32_t, stlpmtx_std::char_traits<uint32_t> >]': /usr/local/include/stlport/stl/_num_put.h:69: instantiated from `_OutputIter stlpmtx_std::num_put<_CharT, _OutputIter>::put(_OutputIter, stlpmtx_std::ios_base&, _CharT, long int) const [with _CharT = uint32_t, _OutputIter = stlpmtx_std::ostreambuf_iterator<uint32_t, stlpmtx_std::char_traits<uint32_t> >]' /usr/local/include/stlport/stl/_ostream.c:193: instantiated from `stlpmtx_std::basic_ostream<_CharT, _Traits>& stlpmtx_std::_M_put_num(stlpmtx_std::basic_ostream<_CharT, _Traits>&, _Number) [with _CharT = uint32_t, _Traits = stlpmtx_std::char_traits<uint32_t>, _Number = long int]' /usr/local/include/stlport/stl/_ostream.c:224: instantiated from `stlpmtx_std::basic_ostream<_CharT, _Traits>& stlpmtx_std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = uint32_t, _Traits = stlpmtx_std::char_traits<uint32_t>]' locale-test.cpp:16: instantiated from here /usr/local/include/stlport/stl/_num_put.c:477: error: call of overloaded `__put_integer(char*&, char*, stlpmtx_std::ostreambuf_iterator<uint32_t, stlpmtx_std::char_traits<uint32_t> >&, stlpmtx_std::ios_base&, int&, uint32_t&)' is ambiguous /usr/local/include/stlport/stl/_num_put.c:203: note: candidates are: _OutputIter stlpmtx_std::__put_integer(char*, char*, _OutputIter, stlpmtx_std::ios_base&, int, wchar_t) [with _OutputIter = stlpmtx_std::ostreambuf_iterator<uint32_t, stlpmtx_std::char_traits<uint32_t> >] /usr/local/include/stlport/stl/_num_put.c:246: note: _OutputIter stlpmtx_std::__put_integer(char*, char*, _OutputIter, stlpmtx_std::ios_base&, int, char) [with _OutputIter = stlpmtx_std::ostreambuf_iterator<uint32_t, stlpmtx_std::char_traits<uint32_t> >] /usr/local/include/stlport/stl/_num_put.c: In function `_OutputIter stlpmtx_std::_M_do_put_float(_OutputIter, stlpmtx_std::ios_base&, _CharT, _Float) [with _CharT = long unsigned int, _OutputIter = stlpmtx_std::ostreambuf_iterator<uint32_t, stlpmtx_std::char_traits<uint32_t> >, _Float = double]': /usr/local/include/stlport/stl/_num_put.c:497: instantiated from `_OutputIter stlpmtx_std::num_put<_CharT, _OutputIter>::do_put(_OutputIter, stlpmtx_std::ios_base&, _CharT, double) const [with _CharT = uint32_t, _OutputIter = stlpmtx_std::ostreambuf_iterator<uint32_t, stlpmtx_std::char_traits<uint32_t> >]' /usr/local/include/stlport/stl/_num_put.h:91: instantiated from `_OutputIter stlpmtx_std::num_put<_CharT, _OutputIter>::put(_OutputIter, stlpmtx_std::ios_base&, _CharT, double) const [with _CharT = uint32_t, _OutputIter = stlpmtx_std::ostreambuf_iterator<uint32_t, stlpmtx_std::char_traits<uint32_t> >]' /usr/local/include/stlport/stl/_ostream.c:193: instantiated from `stlpmtx_std::basic_ostream<_CharT, _Traits>& stlpmtx_std::_M_put_num(stlpmtx_std::basic_ostream<_CharT, _Traits>&, _Number) [with _CharT = uint32_t, _Traits = stlpmtx_std::char_traits<uint32_t>, _Number = double]' /usr/local/include/stlport/stl/_ostream.c:261: instantiated from `stlpmtx_std::basic_ostream<_CharT, _Traits>& stlpmtx_std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = uint32_t, _Traits = stlpmtx_std::char_traits<uint32_t>]' locale-test.cpp:16: instantiated from here /usr/local/include/stlport/stl/_num_put.c:127: error: invalid static_cast from type `const stlpmtx_std::locale::facet*' to type `const stlpmtx_std::numpunct<uint32_t>*' /usr/local/include/stlport/stl/_num_put.c:129: error: 'const class stlpmtx_std::numpunct<uint32_t>' has no member named 'decimal_point' /usr/local/include/stlport/stl/_num_put.c:129: error: 'const class stlpmtx_std::numpunct<uint32_t>' has no member named 'thousands_sep'