divvun / libdivvun

lib for running gramcheck and other pipelines + cli; modules for CG→spelling, CG→feedback, tagging blanks
https://giellalt.github.io/proof/gramcheck/GrammarCheckerDocumentation.html
GNU General Public License v3.0
9 stars 1 forks source link

Use C++17; Use host utfcpp / utf8cpp; Drop bundled mapbox::variant #78

Closed TinoDidriksen closed 2 months ago

TinoDidriksen commented 2 months ago

Some yak shaving I came across while looking at implementing STREAMCMD:SETVAR and <sh> in pipespec.xml.

Tested that it builds on macOS, Ubuntu 20.04, and latest Debian Unstable, so it should be fine. Draft PR, as I'll just push directly to master if there are no blockers.

flammie commented 2 months ago

Trying to compile now, I get

pipespec.cpp: In function 'std::vector<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > > divvun::toPipeSpecShVector(const PipeSpec&, const std::u16string&, bool, bool)':
pipespec.cpp:216:111: error: incomplete type 'std::numeric_limits<int>' used in nested name specifier
  216 |                         int weight_classes = cmd.attribute("weight-classes").as_int(std::numeric_limits<int>::max());
      |                                                                                                               ^~~
pipespec.cpp:218:72: error: incomplete type 'std::numeric_limits<int>' used in nested name specifier
  218 |                         if (weight_classes < std::numeric_limits<int>::max()) {
      |                                                                        ^~~

which can be patched by #include <limits> but not sure if it's relevant to this patch or earlier bitrot on my system:

 $ g++ --version
g++ (Gentoo 13.3.1_p20240614 p17) 13.3.1 20240614
TinoDidriksen commented 2 months ago

Weird that I didn't get that. I built on Debian Sid, which has g++ 14. But yes, that's common bitrot as standard headers get slimmed down.