[LyX/master] Do not return copies of string members

Enrico Forestieri forenr at lyx.org
Thu May 11 21:04:34 UTC 2023


On Thu, May 11, 2023 at 08:51:13PM +0200, Enrico Forestieri wrote:
> 
>On Thu, May 11, 2023 at 07:59:48PM +0200, Enrico Forestieri wrote:
>>
>>On Thu, May 11, 2023 at 04:32:45PM +0200, Jean-Marc Lasgouttes wrote:
>>>
>>>Is this somthing special about cygwin or is our autoconf test broken?
>>
>>The former, I think.
>
>Or not, maybe, see below.
>
>>This is what I get when comparing cygwin and native windows 
>>configuration:
>>
>>$ diff -up build-cygwin/config.h build-win32/config.h | grep -B1 STD_STRING
>>/* std::string uses copy-on-write */
>>-#define STD_STRING_USES_COW 1
>>+/* #undef STD_STRING_USES_COW */
>>
>>So, cygwin is using COW in the std::string implementation...
>
>I hacked config.h by undefining STD_STRING_USES_COW and recompiled.
>LyX does not crash anymore and works fine, seemingly...

Anyway, I don't think the autoconf test is broken because:

$ diff -up /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/x86_64-pc-cygwin/bits/c++config.h /usr/lib/gcc/x86_64-w64-mingw32/11/include/c++/x86_64-w64-mingw32/bits/c++config.h | grep -C1 _GLIBCXX_USE_CXX11_ABI

  #ifndef _GLIBCXX_USE_CXX11_ABI
-# define _GLIBCXX_USE_CXX11_ABI 0
+# define _GLIBCXX_USE_CXX11_ABI 1
  #endif

-- 
Enrico


More information about the lyx-devel mailing list