changeset 3979:7627246c7a83

Standard specification idiom. Make mbswidth.h self contained.
author Bruno Haible <bruno@clisp.org>
date Tue, 19 Nov 2002 13:58:18 +0000
parents 55eb3920b607
children fa7d92f06e6c
files lib/ChangeLog lib/mbswidth.c lib/mbswidth.h
diffstat 3 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,5 +1,8 @@
 2002-11-19  Bruno Haible  <bruno@clisp.org>
 
+	* mbswidth.c: Include mbswidth.h right at the beginning.
+	* mbswidth.h: Include <stddef.h>, for size_t.
+
 	* mbswidth.h (PARAMS): Remove macro.
 	(mbswidth, mbsnwidth): Use ANSI C function declarations.
 	* mbswidth.c (mbswidth, mbsnwidth): Likewise.
--- a/lib/mbswidth.c
+++ b/lib/mbswidth.c
@@ -21,6 +21,9 @@
 # include <config.h>
 #endif
 
+/* Specification.  */
+#include "mbswidth.h"
+
 /* Get MB_CUR_MAX.  */
 #include <stdlib.h>
 
@@ -78,8 +81,6 @@
 #undef ISCNTRL
 #define ISCNTRL(c) (IN_CTYPE_DOMAIN (c) && iscntrl (c))
 
-#include "mbswidth.h"
-
 /* Returns the number of columns needed to represent the multibyte
    character string pointed to by STRING.  If a non-printable character
    occurs, and MBSW_REJECT_UNPRINTABLE is specified, -1 is returned.
--- a/lib/mbswidth.h
+++ b/lib/mbswidth.h
@@ -15,6 +15,8 @@
    along with this program; if not, write to the Free Software Foundation,
    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
+#include <stddef.h>
+
 /* Optional flags to influence mbswidth/mbsnwidth behavior.  */
 
 /* If this bit is set, return -1 upon finding an invalid or incomplete