• Tor Lillqvist's avatar
    Avoid gengal hanging in an --enable-dbgutil build on Windows · 2ff121f2
    Tor Lillqvist yazdı
    With a newer C++ debug runtime (in an --enable-dbgutil build), passing
    an invalid locale name causes an attempt to display an error
    dialog. Which does not even show up, at least for me, but instead the
    process (gengal, at least) just hangs. Which is far from ideal.
    
    Passing a POSIX-style locale name to the std::locale constructor on
    Windows is a bit odd, but apparently in the normal C++ runtime it
    "just" causes an exception to be thrown, that boost catches (see the
    loadable(std::string name) in boost's libs\locale\src\std\std_backend.cpp),
    and then instead uses the Windows style locale name it knows how to
    construct. (Why it even tries the POSIX style name on Windows I can't
    understand.)
    
    Actually it isn't just the locale name part "en_US" of a locale like
    "en_US.UTF-8" that is problematic, but also the encoding part,
    "UTF-8". The Microsoft C/C++ library does not support UTF-8
    locales. The error message that our own report hook catches says:
    "f:\dd\vctools\crt\crtw32\stdcpp\xmbtowc.c(89) : Assertion failed:
    ploc->_Mbcurmax == 1 || ploc->_Mbcurmax == 2". Clearly in a UTF-8
    locale (perhaps one that boost internally constructs?) the maximum
    bytes per character will be more than 2.
    
    With a debug C++ runtime, we need to avoid the error dialog, and just
    ignore the error. So we install an own CRT error report hook that
    ignores the error for the duration of the locale construcion.
    
    Change-Id: Ia2ca994f03d1ce94ce7e9d7607f204c320ab8f2d
    Reviewed-on: https://gerrit.libreoffice.org/54110Tested-by: 's avatarJenkins <ci@libreoffice.org>
    Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
    2ff121f2
Adı
Son kayıt (commit)
Son güncelleme
..
inc Loading commit data...
qa Loading commit data...
source Loading commit data...
util Loading commit data...
CppunitTest_unotools_fontdefs.mk Loading commit data...
JunitTest_unotools_complex.mk Loading commit data...
Library_utl.mk Loading commit data...
Makefile Loading commit data...
Module_unotools.mk Loading commit data...
README Loading commit data...