[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mbswidth.c portability fix for UnixWare 7.1.1
From: |
Paul Eggert |
Subject: |
Re: mbswidth.c portability fix for UnixWare 7.1.1 |
Date: |
Fri, 28 Feb 2003 01:05:06 -0800 (PST) |
I installed the following patch into Bison. OK to check into gnulib?
It seems pretty straightforward.
2003-02-28 Paul Eggert <address@hidden>
* lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
around a UnixWare 7.1.1 porting bug reported by John Hughes in
<http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
Index: mbswidth.c
===================================================================
RCS file: /cvsroot/bison/bison/lib/mbswidth.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -p -u -r1.2 -r1.3
--- mbswidth.c 23 Nov 2002 07:08:51 -0000 1.2
+++ mbswidth.c 28 Feb 2003 09:00:22 -0000 1.3
@@ -1,5 +1,5 @@
/* Determine the number of screen columns needed for a string.
- Copyright (C) 2000-2002 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002, 2003 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
@@ -21,6 +21,15 @@
# include <config.h>
#endif
+/* Get mbstate_t, mbrtowc(), mbsinit(), wcwidth(). This must be
+ included before "mbswidth.h", because UnixWare 7.1.1 <wchar.h>
+ declares its own mbswidth and we want mbswidth.h's "#define
+ mbswidth gnu_mbswidth" to take effect after <wchar.h> is
+ included. */
+#if HAVE_WCHAR_H
+# include <wchar.h>
+#endif
+
/* Specification. */
#include "mbswidth.h"
@@ -31,11 +40,6 @@
/* Get isprint(). */
#include <ctype.h>
-
-/* Get mbstate_t, mbrtowc(), mbsinit(), wcwidth(). */
-#if HAVE_WCHAR_H
-# include <wchar.h>
-#endif
/* Get iswprint(), iswcntrl(). */
#if HAVE_WCTYPE_H
- Re: mbswidth.c portability fix for UnixWare 7.1.1,
Paul Eggert <=