@@ -154,8 +154,8 @@ int TextFormatter::apr(File& f, const char *fmt, ...)
154154 while (*fmt++ != ' g' );
155155 case ' g' :
156156 x = va_arg (ap, double );
157- #define NL_LIB_USE_TO_CHARS
158- #ifdef NL_LIB_USE_TO_CHARS
157+ #ifndef NLW2_LIB_DMGAY_DTOA
158+ #ifndef NL_LIB_USE_OWN_GFMT
159159 std::to_chars_result res;
160160 if (output_prec <= 0 ) // shortest representation
161161 res = std::to_chars (s = buf, buf+sizeof (buf)-1 , x);
@@ -168,9 +168,10 @@ int TextFormatter::apr(File& f, const char *fmt, ...)
168168 else
169169 Utils ().myexit (" aprintf / to_chars bug: " +
170170 std::make_error_code (res.ec ).message ());
171- #elif NL_LIB_USE_OWN_GFMT
171+ #else // NL_LIB_USE_OWN_GFMT
172172 NL_LIB_GFMT::gfmt (s = buf, sizeof (buf), x, output_prec);
173- #else
173+ #endif // NL_LIB_USE_OWN_GFMT
174+ #else // NLW2_LIB_DMGAY_DTOA
174175 s = DAVID_GAY_GFMT::gfmt (x, output_prec);
175176#endif
176177 goto have_s;
@@ -319,7 +320,7 @@ apr(File& f, const char *fmt, ...)
319320} // namespace mp
320321
321322
322- #ifndef NL_LIB_USE_TO_CHARS
323+ #ifdef NLW2_LIB_DMGAY_DTOA
323324
324325extern " C" {
325326char *
@@ -417,6 +418,10 @@ gfmt(double x, int prec)
417418
418419} // namespace DAVID_GAY_GFMT
419420
421+ #endif // NLW2_LIB_DMGAY_DTOA
422+
423+
424+ #ifdef NL_LIB_USE_OWN_GFMT
420425
421426namespace NL_LIB_GFMT {
422427
@@ -475,4 +480,4 @@ void gfmt(char *b, size_t sz, double x, int prec) {
475480
476481} // namespace NL_LIB_GFMT
477482
478- #endif // NL_LIB_USE_TO_CHARS
483+ #endif // NL_LIB_USE_OWN_GFMT
0 commit comments