Current master uncompilable on cygwin
Enrico Forestieri
forenr at lyx.org
Sat Jul 11 14:16:49 UTC 2020
On Sat, Jul 11, 2020 at 08:34:13AM -0400, Richard Kimberly Heck wrote:
> On 7/11/20 8:02 AM, Enrico Forestieri wrote:
> > On Fri, Jul 10, 2020 at 10:18:27PM +0200, Enrico Forestieri wrote:
> >
> >> This is what I get:
> >>
> >> CXX Buffer.o
> >> In file included from /usr/lib/gcc/x86_64-pc-cygwin/9.3.0/include/c++/unordered_set:46,
> >> from ../../src/OutputParams.h:19,
> >> from ../../src/Format.h:18,
> >> from ../../src/BufferParams.h:21,
> >> from ../../src/BiblioInfo.h:20,
> >> from ../../src/Buffer.cpp:18:
> > [...]
> >> make[4]: *** [Makefile:2213: Buffer.o] Errore 1
> > This is due to the recent docbook support. The failure occurs on all
> > platforms for which sizeof(wchar_t) == 2 (such as cygwin and mingw)
> > or for which HAVE_WCHAR_T is not defined (possibly FreeBSD and others).
> >
> > The failure can be replicated on linux by editing config.h and changing
> > #define SIZEOF_WCHAR_T 4
> > to
> > #define SIZEOF_WCHAR_T 2
> > and recompiling.
>
> Does it help to use set.h instead of unordered_set.h? (I don't have
> SIZEOF_WCHAR_T in my config.h, at least not with cmake.)
Yes, replacing "unordered_set" with "set" works. Also the attached patch
works, but I think your workaround is better.
--
Enrico
-------------- next part --------------
diff --git a/src/OutputParams.cpp b/src/OutputParams.cpp
index 9b842980f7..8bd5497f11 100644
--- a/src/OutputParams.cpp
+++ b/src/OutputParams.cpp
@@ -34,7 +34,7 @@ OutputParams::OutputParams(Encoding const * enc)
dryrun(false), silent(false), pass_thru(false),
html_disable_captions(false), html_in_par(false),
html_make_pars(true), docbook_in_par(false), docbook_make_pars(true),
- docbook_force_pars(false), docbook_anchors_to_ignore(std::unordered_set<docstring>()), docbook_in_float(false),
+ docbook_force_pars(false), docbook_anchors_to_ignore(std::unordered_set<std::string>()), docbook_in_float(false),
docbook_in_listing(false), for_toc(false), for_tooltip(false),
for_search(false), for_preview(false), includeall(false)
{
diff --git a/src/OutputParams.h b/src/OutputParams.h
index 9b4fdbf000..d3b1b38988 100644
--- a/src/OutputParams.h
+++ b/src/OutputParams.h
@@ -361,7 +361,7 @@ public:
bool docbook_force_pars;
/// Anchors that should not be output (LyX-side identifier, not DocBook-side).
- std::unordered_set<docstring> docbook_anchors_to_ignore;
+ std::unordered_set<std::string> docbook_anchors_to_ignore;
/// Is the current context a float (such as a table or a figure)?
bool docbook_in_float;
diff --git a/src/insets/InsetFloat.cpp b/src/insets/InsetFloat.cpp
index c9f90faf90..0ac6c9f9aa 100644
--- a/src/insets/InsetFloat.cpp
+++ b/src/insets/InsetFloat.cpp
@@ -588,7 +588,7 @@ void InsetFloat::docbook(XMLStream & xs, OutputParams const & runparams) const
// Ensure there is no label output, it is supposed to be handled as xml:id.
OutputParams rpNoLabel = runparams;
if (label)
- rpNoLabel.docbook_anchors_to_ignore.emplace(label->screenLabel());
+ rpNoLabel.docbook_anchors_to_ignore.emplace(to_utf8(label->screenLabel()));
// Ensure the float does not output its caption, as it is handled here (DocBook mandates a specific place for
// captions, they cannot appear at the end of the float, albeit LyX is happy with that).
diff --git a/src/insets/InsetLabel.cpp b/src/insets/InsetLabel.cpp
index ec50d4feb6..cc429bf1aa 100644
--- a/src/insets/InsetLabel.cpp
+++ b/src/insets/InsetLabel.cpp
@@ -353,7 +353,7 @@ int InsetLabel::plaintext(odocstringstream & os,
void InsetLabel::docbook(XMLStream & xs, OutputParams const & runparams) const
{
// Output an anchor only if it has not been processed before.
- if (runparams.docbook_anchors_to_ignore.find(getParam("name")) == runparams.docbook_anchors_to_ignore.end()) {
+ if (runparams.docbook_anchors_to_ignore.find(to_utf8(getParam("name"))) == runparams.docbook_anchors_to_ignore.end()) {
docstring attr = from_utf8("xml:id=\"") + xml::cleanID(getParam("name")) + from_utf8("\"");
xs << xml::CompTag("anchor", to_utf8(attr));
}
diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp
index a8ac4eaa3e..21eb41bb8c 100644
--- a/src/output_docbook.cpp
+++ b/src/output_docbook.cpp
@@ -952,7 +952,7 @@ void docbookParagraphs(Text const &text,
id += "xml:id=\"" + xml::cleanID(label->screenLabel()) + "\"";
// Don't output the ID as a DocBook <anchor>.
- ourparams.docbook_anchors_to_ignore.emplace(label->screenLabel());
+ ourparams.docbook_anchors_to_ignore.emplace(to_utf8(label->screenLabel()));
// Cannot have multiple IDs per tag.
break;
More information about the lyx-devel
mailing list