changeset 7852:72bd6a3bf181

* lib/wctype_.h [HAVE_WINT_T]: Include <stddef.h> before <wchar.h>, to work around BSDI bug in BSD/OS 4.0.1. * m4/wcwidth.m4 (gl_FUNC_WCWIDTH): Likewise. * m4/wint_t.m4 (gt_TYPE_WINT_T): Likewise. Reported by Chris McGuire.
author Eric Blake <ebb9@byu.net>
date Wed, 10 Jan 2007 13:46:26 +0000
parents e46ebc8d4ce9
children 9ddbddb3fc43
files ChangeLog lib/wctype_.h m4/wcwidth.m4 m4/wint_t.m4
diffstat 4 files changed, 28 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-01-10  Eric Blake  <ebb9@byu.net>
+
+	* lib/wctype_.h [HAVE_WINT_T]: Include <stddef.h> before
+	<wchar.h>, to work around BSDI bug in BSD/OS 4.0.1.
+	* m4/wcwidth.m4 (gl_FUNC_WCWIDTH): Likewise.
+	* m4/wint_t.m4 (gt_TYPE_WINT_T): Likewise.
+	Reported by Chris McGuire.
+
 2007-01-09  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
 	* gnulib-tool (func_all_modules): Use POSIX conforming escaping
--- a/lib/wctype_.h
+++ b/lib/wctype_.h
@@ -1,6 +1,6 @@
 /* A substitute for ISO C99 <wctype.h>, for platforms that lack it.
 
-   Copyright (C) 2006 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2007 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -33,8 +33,9 @@
 /* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>.
    Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
    <wchar.h>.
-   BSD/OS 4.1 has a bug: <stdio.h> and <time.h> must be included before
-   <wchar.h>.  */
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+# include <stddef.h>
 # include <stdio.h>
 # include <time.h>
 # include <wchar.h>
--- a/m4/wcwidth.m4
+++ b/m4/wcwidth.m4
@@ -1,5 +1,5 @@
-# wcwidth.m4 serial 6
-dnl Copyright (C) 2006 Free Software Foundation, Inc.
+# wcwidth.m4 serial 7
+dnl Copyright (C) 2006, 2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -22,8 +22,9 @@
 #if HAVE_WCHAR_H
 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
    <wchar.h>.
-   BSD/OS 4.1 has a bug: <stdio.h> and <time.h> must be included before
-   <wchar.h>.  */
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
+   before <wchar.h>.  */
+# include <stddef.h>
 # include <stdio.h>
 # include <time.h>
 # include <wchar.h>
--- a/m4/wint_t.m4
+++ b/m4/wint_t.m4
@@ -1,5 +1,5 @@
-# wint_t.m4 serial 1 (gettext-0.12)
-dnl Copyright (C) 2003 Free Software Foundation, Inc.
+# wint_t.m4 serial 2 (gettext-0.12)
+dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -11,7 +11,15 @@
 AC_DEFUN([gt_TYPE_WINT_T],
 [
   AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
-    [AC_TRY_COMPILE([#include <wchar.h>
+    [AC_TRY_COMPILE([
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
+   before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
        wint_t foo = (wchar_t)'\0';], ,
        gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
   if test $gt_cv_c_wint_t = yes; then