# HG changeset patch # User Bruno Haible # Date 1229562194 -3600 # Node ID c6a367263f5227f1449eb505e48557ac7adc2ff0 # Parent 45e1c3577b496f823c66d71fdcf291aaddab778e Verify an assumption. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-12-17 Bruno Haible + + * lib/mbsinit.c: Include verify.h. Verify an assumption. + * modules/mbsinit (Depends-on): Add verify. + Suggested by Paul Eggert. + 2008-12-17 Bruno Haible * m4/mbrtowc.m4 (AC_FUNC_MBRTOWC): Renamed from gl_FUNC_MBRTOWC. diff --git a/lib/mbsinit.c b/lib/mbsinit.c --- a/lib/mbsinit.c +++ b/lib/mbsinit.c @@ -20,6 +20,8 @@ /* Specification. */ #include +#include "verify.h" + /* Platforms that lack mbsinit() also lack mbrlen(), mbrtowc(), mbsrtowcs() and wcrtomb(), wcsrtombs(). We assume that @@ -34,6 +36,8 @@ - In wc -> mb direction, mbstate_t contains no information. In other words, it is always in the initial state. */ +verify (sizeof (mbstate_t) >= 4); + int mbsinit (const mbstate_t *ps) { diff --git a/modules/mbsinit b/modules/mbsinit --- a/modules/mbsinit +++ b/modules/mbsinit @@ -8,6 +8,7 @@ Depends-on: wchar +verify configure.ac: gl_FUNC_MBSINIT