Verify an assumption.
authorBruno Haible <bruno@clisp.org>
Thu, 18 Dec 2008 01:03:14 +0000 (02:03 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 18 Dec 2008 01:03:14 +0000 (02:03 +0100)
ChangeLog
lib/mbsinit.c
modules/mbsinit

index e6af381..122bcfe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2008-12-17  Bruno Haible  <bruno@clisp.org>
 
+       * lib/mbsinit.c: Include verify.h. Verify an assumption.
+       * modules/mbsinit (Depends-on): Add verify.
+       Suggested by Paul Eggert.
+
+2008-12-17  Bruno Haible  <bruno@clisp.org>
+
        * m4/mbrtowc.m4 (AC_FUNC_MBRTOWC): Renamed from gl_FUNC_MBRTOWC.
        * m4/mbfile.m4 (gl_MBFILE): Use AC_FUNC_MBRTOWC instead of
        gl_FUNC_MBRTOWC.
index 2753b41..81fed5a 100644 (file)
@@ -20,6 +20,8 @@
 /* Specification.  */
 #include <wchar.h>
 
+#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)
 {
index e8a3ef9..173adf2 100644 (file)
@@ -8,6 +8,7 @@ m4/mbstate_t.m4
 
 Depends-on:
 wchar
+verify
 
 configure.ac:
 gl_FUNC_MBSINIT