From 5be230d9158e5aa42852fe06ea00f8052eff2e39 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Wed, 10 Jan 2007 22:25:03 +0000
Subject: [PATCH] Use @...@ consistently in lib/wctype_.h. * lib/wctype_.h
 [HAVE_WINT_T]: Go back to using @...@, but rely on it being set to 1 or 0. *
 m4/wctype.m4 (gl_WCTYPE_H): Set HAVE_WINT_T to 1 or 0, and go back to
 AC_SUBSTing it. * modules/wctype (Makefile.am): Undo previous change.

---
 ChangeLog      | 9 +++++++++
 lib/wctype_.h  | 2 +-
 m4/wctype.m4   | 8 ++++++--
 modules/wctype | 1 +
 4 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e93b10c16a..4785063fc4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-01-10  Paul Eggert  <eggert@cs.ucla.edu>
+
+	Use @...@ consistently in lib/wctype_.h.
+	* lib/wctype_.h [HAVE_WINT_T]: Go back to using @...@, but rely
+	on it being set to 1 or 0.
+	* m4/wctype.m4 (gl_WCTYPE_H): Set HAVE_WINT_T to 1 or 0, and
+	go back to AC_SUBSTing it.
+	* modules/wctype (Makefile.am): Undo previous change.
+
 2007-01-10  Eric Blake  <ebb9@byu.net>
 
 	* lib/wctype_.h [HAVE_WINT_T]: Rely on AC_DEFINE.
diff --git a/lib/wctype_.h b/lib/wctype_.h
index 3cd3c8750d..1297c61e62 100644
--- a/lib/wctype_.h
+++ b/lib/wctype_.h
@@ -29,7 +29,7 @@
 #ifndef _GL_WCTYPE_H
 #define _GL_WCTYPE_H
 
-#if HAVE_WINT_T - 0
+#if @HAVE_WINT_T@
 /* 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>.
diff --git a/m4/wctype.m4 b/m4/wctype.m4
index 001d54edb1..62994c62ba 100644
--- a/m4/wctype.m4
+++ b/m4/wctype.m4
@@ -7,8 +7,6 @@ dnl with or without modifications, as long as this notice is preserved.
 
 dnl Written by Paul Eggert.
 
-# wctype.m4 serial 2
-
 AC_DEFUN([gl_WCTYPE_H],
 [
   AC_CHECK_FUNCS_ONCE([iswcntrl])
@@ -16,6 +14,12 @@ AC_DEFUN([gl_WCTYPE_H],
   AC_REQUIRE([AC_C_INLINE])
 
   AC_REQUIRE([gt_TYPE_WINT_T])
+  if test $gt_cv_c_wint_t = yes; then
+    HAVE_WINT_T=1
+  else
+    HAVE_WINT_T=0
+  fi
+  AC_SUBST([HAVE_WINT_T])
 
   WCTYPE_H=wctype.h
   if test $ac_cv_header_wctype_h = yes; then
diff --git a/modules/wctype b/modules/wctype
index e514a2d9aa..a6fd3467e9 100644
--- a/modules/wctype
+++ b/modules/wctype
@@ -23,6 +23,7 @@ wctype.h: wctype_.h
 	  sed -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \
 	      -e 's|@''ABSOLUTE_WCTYPE_H''@|$(ABSOLUTE_WCTYPE_H)|g' \
 	      -e 's/@''HAVE_WCTYPE_CTMP_BUG''@/$(HAVE_WCTYPE_CTMP_BUG)/g' \
+	      -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \
 	      < $(srcdir)/wctype_.h; \
 	} > $@-t
 	mv $@-t $@
-- 
2.39.5