diff options
author | Bruno Haible <bruno@clisp.org> | 2023-04-19 17:59:03 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2023-04-19 17:59:03 +0200 |
commit | ccb59e4c36bea4915303a24ea1c7dec109db97eb (patch) | |
tree | 30eb5e84cca4b21d1a18982cd5676fe80aaed08e /modules | |
parent | 9bf6bcc74b4caf4d74bab8d98a4e00f761f2e5ca (diff) | |
download | gnulib-ccb59e4c36bea4915303a24ea1c7dec109db97eb.tar.gz |
wcsncmp: Work around two ISO C compliance bugs on several platforms.
* lib/wchar.in.h (wcsncmp): Consider REPLACE_WCSNCMP.
* lib/wcsncmp-impl.h (wcsncmp): Don't assume that the two wide
characters are in the range 0..INT_MAX.
* m4/wcsncmp.m4 (gl_FUNC_WCSNCMP): Test whether wcsncmp works for all
wide characters. Set REPLACE_WCSNCMP.
* m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Initialize REPLACE_WCSNCMP.
* modules/wchar (Makefile.am): Substitute REPLACE_WCSNCMP.
* modules/wcsncmp (Status, Notice): Un-obsolete this module.
(configure.ac): Consider REPLACE_WCSNCMP.
* doc/posix-functions/wcsncmp.texi: Mention the two bugs.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/wchar | 1 | ||||
-rw-r--r-- | modules/wcsncmp | 9 |
2 files changed, 3 insertions, 7 deletions
diff --git a/modules/wchar b/modules/wchar index 88b442b525..e0dd69268d 100644 --- a/modules/wchar +++ b/modules/wchar @@ -143,6 +143,7 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) -e 's|@''REPLACE_WCSWIDTH''@|$(REPLACE_WCSWIDTH)|g' \ -e 's|@''REPLACE_WCSFTIME''@|$(REPLACE_WCSFTIME)|g' \ -e 's|@''REPLACE_WCSCMP''@|$(REPLACE_WCSCMP)|g' \ + -e 's|@''REPLACE_WCSNCMP''@|$(REPLACE_WCSNCMP)|g' \ -e 's|@''REPLACE_WCSSTR''@|$(REPLACE_WCSSTR)|g' \ -e 's|@''REPLACE_WCSTOK''@|$(REPLACE_WCSTOK)|g' \ -e 's|@''REPLACE_WMEMCMP''@|$(REPLACE_WMEMCMP)|g' \ diff --git a/modules/wcsncmp b/modules/wcsncmp index a09ab92bfd..e67861d359 100644 --- a/modules/wcsncmp +++ b/modules/wcsncmp @@ -1,12 +1,6 @@ Description: wcsncmp() function: compare two wide strings. -Status: -obsolete - -Notice: -This module is obsolete. - Files: lib/wcsncmp.c lib/wcsncmp-impl.h @@ -17,7 +11,8 @@ wchar configure.ac: gl_FUNC_WCSNCMP -gl_CONDITIONAL([GL_COND_OBJ_WCSNCMP], [test $HAVE_WCSNCMP = 0]) +gl_CONDITIONAL([GL_COND_OBJ_WCSNCMP], + [test $HAVE_WCSNCMP = 0 || test $REPLACE_WCSNCMP = 1]) gl_WCHAR_MODULE_INDICATOR([wcsncmp]) Makefile.am: |