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 e6af381c2d59b3a84eebaeedc95f1197c0e38cf6..122bcfed5356094a650e23545cf6595917378a85 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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.
index 2753b4175b6ee3b7852d17d3d4cff486ba6a2e64..81fed5a12b8849a8df57809aeddc139bdb201b88 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 e8a3ef97ecf24cd9b3c568cdc95712194544a3d1..173adf2f2d5a0933ff485a379fb75ca27fc0a066 100644 (file)
@@ -8,6 +8,7 @@ m4/mbstate_t.m4
 
 Depends-on:
 wchar
+verify
 
 configure.ac:
 gl_FUNC_MBSINIT