c-strtof, c-strtod, c-strtold: Make multithread-safe.
commit6fd67ba785973da738c52663a38a8e81a6fdc848
authorBruno Haible <bruno@clisp.org>
Tue, 5 Mar 2024 16:10:38 +0000 (5 17:10 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 5 Mar 2024 16:10:38 +0000 (5 17:10 +0100)
tree9cc78768e604ddf2bc580e1d040a03617ab5da24
parent8eaecd9d8b9ef6ab8df15ca5c880948a42484c9a
c-strtof, c-strtod, c-strtold: Make multithread-safe.

* lib/c-strtod.c: Include <langinfo.h>, c-ctype.h.
(decimal_point_char): New function, copied from lib/vasnprintf.c.
(C_STRTOD): On platforms that don't have STRTOD_L nor a working
uselocale(), pre-parse the number and call STRTOD after having replaced
the '.' with the locale-dependent decimal point character.
* m4/c-strtod.m4 (gl_C_STRTOD, gl_C_STRTOF, gl_C_STRTOLD): Test for
nl_langinfo().
* modules/c-strtof (Depends-on): Add c-ctype. Remove strdup-posix.
* modules/c-strtod (Depends-on): Likewise.
* modules/c-strtold (Depends-on): Likewise.
ChangeLog
lib/c-strtod.c
m4/c-strtod.m4
modules/c-strtod
modules/c-strtof
modules/c-strtold