@@ -154,8 +154,8 @@ int TextFormatter::apr(File& f, const char *fmt, ...)
154
154
while (*fmt++ != ' g' );
155
155
case ' g' :
156
156
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
159
159
std::to_chars_result res;
160
160
if (output_prec <= 0 ) // shortest representation
161
161
res = std::to_chars (s = buf, buf+sizeof (buf)-1 , x);
@@ -168,9 +168,10 @@ int TextFormatter::apr(File& f, const char *fmt, ...)
168
168
else
169
169
Utils ().myexit (" aprintf / to_chars bug: " +
170
170
std::make_error_code (res.ec ).message ());
171
- #elif NL_LIB_USE_OWN_GFMT
171
+ #else // NL_LIB_USE_OWN_GFMT
172
172
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
174
175
s = DAVID_GAY_GFMT::gfmt (x, output_prec);
175
176
#endif
176
177
goto have_s;
@@ -319,7 +320,7 @@ apr(File& f, const char *fmt, ...)
319
320
} // namespace mp
320
321
321
322
322
- #ifndef NL_LIB_USE_TO_CHARS
323
+ #ifdef NLW2_LIB_DMGAY_DTOA
323
324
324
325
extern " C" {
325
326
char *
@@ -417,6 +418,10 @@ gfmt(double x, int prec)
417
418
418
419
} // namespace DAVID_GAY_GFMT
419
420
421
+ #endif // NLW2_LIB_DMGAY_DTOA
422
+
423
+
424
+ #ifdef NL_LIB_USE_OWN_GFMT
420
425
421
426
namespace NL_LIB_GFMT {
422
427
@@ -475,4 +480,4 @@ void gfmt(char *b, size_t sz, double x, int prec) {
475
480
476
481
} // namespace NL_LIB_GFMT
477
482
478
- #endif // NL_LIB_USE_TO_CHARS
483
+ #endif // NL_LIB_USE_OWN_GFMT
0 commit comments