vectorgraphics / asymptote

2D & 3D TeX-Aware Vector Graphics Language
https://asymptote.sourceforge.io/
GNU General Public License v3.0
533 stars 89 forks source link

2.86 ftbfs with recent c++ if --without-lsp is used. #379

Closed zarniwhoop73 closed 1 year ago

zarniwhoop73 commented 1 year ago

With 2.86 on recent linuxfromscratch (gcc-13) using '--disable-lsp' I get

symbolmaps.h: In constructor ‘AsymptoteLsp::SymbolInfo::SymbolInfo()’: symbolmaps.h:137:25: error: ‘nullopt’ was not declared in this scope; did you mean ‘std::nullopt’? 137 | SymbolInfo() : type(nullopt), pos(1, 1) {} | ^~~ | std::nullopt

It seems that the change to common.h for 2.86 included an option for non-old cplusplus only in the HAVE_LSP part.

Following fixes the build and passes my limited testing:

diff -Naur a/common.h b/common.h --- a/common.h 2023-06-07 02:59:39.000000000 +0100 +++ b/common.h 2023-06-13 19:57:51.333429562 +0100 @@ -38,6 +38,11 @@ using nonstd::optional; using nonstd::nullopt; using nonstd::make_optional; +#else +#include +using std::optional; +using std::nullopt; +using std::make_optional;

endif

endif

zarniwhoop73 commented 1 year ago

Typo in title, I use '--disable-lsp'