diff options
author | Bruno Haible <bruno@clisp.org> | 2021-04-02 20:42:13 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2021-04-02 20:42:13 +0200 |
commit | 705c23696fcaf5bd9d4f0aaecd106b4a2c1417b2 (patch) | |
tree | 44bd091848a15c9d7bf43f6230982491bd449709 /modules | |
parent | 837ffb5ee4585ce6947e1013d03c7d6f21cbd635 (diff) | |
download | gnulib-705c23696fcaf5bd9d4f0aaecd106b4a2c1417b2.tar.gz |
strtol: Work around a bug on native Windows and Minix.
* lib/stdlib.in.h (strtol): New declaration.
* m4/stdlib_h.m4 (gl_STDLIB_H): Test whether strtol is declared.
(gl_STDLIB_H_DEFAULTS): Initialize GNULIB_STRTOL, HAVE_STRTOL,
REPLACE_STRTOL.
* m4/strtol.m4 (gl_FUNC_STRTOL): Require gl_STDLIB_H_DEFAULTS. Test
whether strtol works. Set REPLACE_STRTOL.
* modules/stdlib (Makefile.am): Substitute GNULIB_STRTOL, HAVE_STRTOL,
REPLACE_STRTOL.
* modules/strtol (Status, Notice): Remove.
(Depends-on): Add stdlib.
(configure.ac): Test HAVE_STRTOL and REPLACE_STRTOL. Invoke
gl_STDLIB_MODULE_INDICATOR.
* tests/test-strtol.c (main): Add tests of hexadecimal integer syntax.
* doc/posix-functions/strtol.texi: Mention the bug.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/stdlib | 3 | ||||
-rw-r--r-- | modules/strtol | 10 |
2 files changed, 6 insertions, 7 deletions
diff --git a/modules/stdlib b/modules/stdlib index 4bd7a5c683..33b8d500cc 100644 --- a/modules/stdlib +++ b/modules/stdlib @@ -62,6 +62,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's/@''GNULIB_SECURE_GETENV''@/$(GNULIB_SECURE_GETENV)/g' \ -e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \ -e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \ + -e 's/@''GNULIB_STRTOL''@/$(GNULIB_STRTOL)/g' \ -e 's/@''GNULIB_STRTOLD''@/$(GNULIB_STRTOLD)/g' \ -e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \ -e 's/@''GNULIB_STRTOUL''@/$(GNULIB_STRTOUL)/g' \ @@ -110,6 +111,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's|@''HAVE_SETSTATE''@|$(HAVE_SETSTATE)|g' \ -e 's|@''HAVE_DECL_SETSTATE''@|$(HAVE_DECL_SETSTATE)|g' \ -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \ + -e 's|@''HAVE_STRTOL''@|$(HAVE_STRTOL)|g' \ -e 's|@''HAVE_STRTOLD''@|$(HAVE_STRTOLD)|g' \ -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \ -e 's|@''HAVE_STRTOUL''@|$(HAVE_STRTOUL)|g' \ @@ -138,6 +140,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \ -e 's|@''REPLACE_SETSTATE''@|$(REPLACE_SETSTATE)|g' \ -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \ + -e 's|@''REPLACE_STRTOL''@|$(REPLACE_STRTOL)|g' \ -e 's|@''REPLACE_STRTOLD''@|$(REPLACE_STRTOLD)|g' \ -e 's|@''REPLACE_STRTOUL''@|$(REPLACE_STRTOUL)|g' \ -e 's|@''REPLACE_STRTOULL''@|$(REPLACE_STRTOULL)|g' \ diff --git a/modules/strtol b/modules/strtol index 65b6946390..24d4c734db 100644 --- a/modules/strtol +++ b/modules/strtol @@ -1,23 +1,19 @@ Description: strtol() function: convert string to 'long'. -Status: -obsolete - -Notice: -This module is obsolete. - Files: lib/strtol.c m4/strtol.m4 Depends-on: +stdlib configure.ac: gl_FUNC_STRTOL -if test $ac_cv_func_strtol = no; then +if test $HAVE_STRTOL = 0 || test $REPLACE_STRTOL = 1; then AC_LIBOBJ([strtol]) fi +gl_STDLIB_MODULE_INDICATOR([strtol]) Makefile.am: |