• Luboš Luňák's avatar
    make OString work even with old gcc that has SFINAE broken · 3d9f5c85
    Luboš Luňák yazdı
    Since OString already has a ctor accepting const char*, I cannot
    find out a way to distinguish string literals other than using
    a template, otherwise const char* somehow takes precedence
    (all of gcc, clang, msvc). But the template requires
    the Substitution Is Not A Failure Idiom to actually create
    only wanted instances. And the compiler can try evaluate
    the OString ctor as a possibility when comparing an int to
    an anonymous enum, and anonymous enum as a type without linkage
    cannot be a template argument before C++11. SFINAE should still
    work, but not with gcc older than 4.0.2 (which we right now
    use only on macs). So for that case disable the string literal
    ctors, which means macs will have one extra strlen call,
    and also that embedded \0's in string literals will be
    inconsistent. The tiny performance problem shouldn't matter that
    much and will eventually go away, the \0 problem should not
    matter, since before string literal ctors were introduced
    \0's had not been included anyway unless RTL_CONSTASCII_STRINGPARAM
    was used. So we should be safe and when removing the CONSTASCII
    macros \0 cases should be handled by explicitly mentioning
    the length.
    3d9f5c85
Adı
Son kayıt (commit)
Son güncelleme
..
bin Loading commit data...
doc/gbuild Loading commit data...
gbuild Loading commit data...
gdb Loading commit data...
inc Loading commit data...
lldb/libreoffice Loading commit data...
prj Loading commit data...
src Loading commit data...
README Loading commit data...
makefile.mk Loading commit data...