changeset 10898:c6a367263f52

Verify an assumption.
author Bruno Haible <bruno@clisp.org>
date Thu, 18 Dec 2008 02:03:14 +0100
parents 45e1c3577b49
children 3a5b73f13a99
files ChangeLog lib/mbsinit.c modules/mbsinit
diffstat 3 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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.
--- a/lib/mbsinit.c
+++ b/lib/mbsinit.c
@@ -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)
 {
--- a/modules/mbsinit
+++ b/modules/mbsinit
@@ -8,6 +8,7 @@
 
 Depends-on:
 wchar
+verify
 
 configure.ac:
 gl_FUNC_MBSINIT