diff options
author | Bruno Haible <bruno@clisp.org> | 2023-04-19 01:01:56 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2023-04-19 01:07:24 +0200 |
commit | 6c28538c9d6bbf692ab12972de6cc035e54b0c67 (patch) | |
tree | 192b7cf854082a8ebc66f8bb81d88bc6acc1fb5f /modules | |
parent | 5c9f32c99a0ad5bb6977c4d416fd6835eeb4fad5 (diff) | |
download | gnulib-6c28538c9d6bbf692ab12972de6cc035e54b0c67.tar.gz |
wmemcmp: Work around ISO C compliance bug on several platforms.
* lib/wchar.in.h (wmemcmp): Consider REPLACE_WMEMCMP.
* lib/wmemcmp-impl.h (wmemcmp): Don't assume that the two wide
characters are in the range 0..INT_MAX.
* m4/wmemcmp.m4 (gl_FUNC_WMEMCMP): Test whether wmemcmp works for all
wide characters. Set REPLACE_WMEMCMP.
* m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Initialize REPLACE_WMEMCMP.
* modules/wchar (Makefile.am): Substitute REPLACE_WMEMCMP.
* modules/wmemcmp (configure.ac): Consider REPLACE_WMEMCMP.
* doc/posix-functions/wmemcmp.texi: Mention the bug.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/wchar | 1 | ||||
-rw-r--r-- | modules/wmemcmp | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/modules/wchar b/modules/wchar index feacaffff1..180c94309c 100644 --- a/modules/wchar +++ b/modules/wchar @@ -144,6 +144,7 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) -e 's|@''REPLACE_WCSFTIME''@|$(REPLACE_WCSFTIME)|g' \ -e 's|@''REPLACE_WCSSTR''@|$(REPLACE_WCSSTR)|g' \ -e 's|@''REPLACE_WCSTOK''@|$(REPLACE_WCSTOK)|g' \ + -e 's|@''REPLACE_WMEMCMP''@|$(REPLACE_WMEMCMP)|g' \ -e 's|@''REPLACE_WMEMPCPY''@|$(REPLACE_WMEMPCPY)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ diff --git a/modules/wmemcmp b/modules/wmemcmp index 219f3c3754..c0e19a5184 100644 --- a/modules/wmemcmp +++ b/modules/wmemcmp @@ -11,7 +11,8 @@ wchar configure.ac: gl_FUNC_WMEMCMP -gl_CONDITIONAL([GL_COND_OBJ_WMEMCMP], [test $HAVE_WMEMCMP = 0]) +gl_CONDITIONAL([GL_COND_OBJ_WMEMCMP], + [test $HAVE_WMEMCMP = 0 || test $REPLACE_WMEMCMP = 1]) gl_WCHAR_MODULE_INDICATOR([wmemcmp]) Makefile.am: |