@@ -26388,6 +26388,8 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
2638826388
2638926389 old_CXXFLAGS=$CXXFLAGS
2639026390 CXXFLAGS="$CXXFLAGS -std=c++17"
26391+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++17 support" >&5
26392+ printf %s "checking for C++17 support... " >&6; }
2639126393 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2639226394/* end confdefs.h. */
2639326395
@@ -26397,24 +26399,68 @@ main (void)
2639726399#if __cplusplus < 201703L
2639826400 #error "Needs C++17 compiler"
2639926401 #endif
26402+
2640026403 ;
2640126404 return 0;
2640226405}
26406+
2640326407_ACEOF
2640426408if ac_fn_cxx_try_compile "$LINENO"
2640526409then :
26406- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++17 support" >&5
26407- printf %s "checking for C++17 support... " >&6; }
26410+
2640826411 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
2640926412printf "%s\n" "yes" >&6; }
2641026413 HAVE_CXX17=true
26414+
26415+ if test "$builtin_ryu" = "no"
26416+ then :
26417+
26418+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ std::to_chars" >&5
26419+ printf %s "checking for C++ std::to_chars... " >&6; }
26420+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26421+ /* end confdefs.h. */
26422+
26423+ #include <charconv>
26424+
26425+ int
26426+ main (void)
26427+ {
26428+
26429+ char fbuf[20];
26430+ std::to_chars(fbuf, fbuf + sizeof(fbuf), 3.14);
26431+
26432+ ;
26433+ return 0;
26434+ }
26435+
26436+ _ACEOF
26437+ if ac_fn_cxx_try_compile "$LINENO"
26438+ then :
26439+
26440+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
26441+ printf "%s\n" "yes" >&6; }
26442+
2641126443else case e in #(
26412- e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++17 support" >&5
26413- printf %s "checking for C++17 support... " >&6; }
26444+ e)
26445+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
26446+ printf "%s\n" "no" >&6; }
26447+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: C++17 support found but no std::to_chars for floating point" >&5
26448+ printf "%s\n" "$as_me: WARNING: C++17 support found but no std::to_chars for floating point" >&2;}
26449+ as_fn_error $? "Alternative to builtin ryu needs C++17 with std::to_chars" "$LINENO" 5
26450+ ;;
26451+ esac
26452+ fi
26453+ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
26454+
26455+ fi
26456+
26457+ else case e in #(
26458+ e)
2641426459 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
2641526460printf "%s\n" "no" >&6; }
2641626461 CXXFLAGS=$old_CXXFLAGS
26417- HAVE_CXX17=false ;;
26462+ HAVE_CXX17=false
26463+ ;;
2641826464esac
2641926465fi
2642026466rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
0 commit comments