This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3] guard cwctype
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 11 Mar 2002 18:40:13 -0800
- Subject: [v3] guard cwctype
As per the cygwin wctype query.
tested x86/linux
2002-03-11 Benjamin Kosnik <bkoz@redhat.com>
* acinclude.m4 (GLIBCPP_CHECK_WCHAR_T_SUPPORT): Check for wctype.h.
* aclocal.m4: Regenerate.
* config.h.in: Regenerate.
* configure: Regenerate.
* include/c_std/std_cwctype.h: Guard.
Index: include/c_std/std_cwctype.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/c_std/std_cwctype.h,v
retrieving revision 1.2
diff -c -p -r1.2 std_cwctype.h
*** std_cwctype.h 2002/01/28 22:13:08 1.2
--- std_cwctype.h 2002/03/12 02:37:45
***************
*** 1,6 ****
// -*- C++ -*- forwarding header.
! // Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
--- 1,7 ----
// -*- C++ -*- forwarding header.
! // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
! // Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
***************
*** 43,50 ****
--- 44,55 ----
#ifndef _CPP_CWCTYPE
#define _CPP_CWCTYPE 1
+ #include <bits/c++config.h>
+
+ #if _GLIBCPP_HAVE_WCTYPE_H
#pragma GCC system_header
#include <wctype.h>
+ #endif
// Get rid of those macros defined in <wctype.h> in lieu of real functions.
#undef iswalnum
***************
*** 67,72 ****
--- 72,78 ----
#undef wctrans
#undef wctype
+ #if _GLIBCPP_USE_WCHAR_T
namespace std
{
using ::wint_t; // cwchar
*************** namespace std
*** 94,98 ****
--- 100,105 ----
using ::wctrans;
using ::wctype;
}
+ #endif //_GLIBCPP_USE_WCHAR_T
#endif
Index: config.h.in
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config.h.in,v
retrieving revision 1.50
diff -c -p -r1.50 config.h.in
*** config.h.in 2002/02/12 04:35:49 1.50
--- config.h.in 2002/03/12 02:37:49
***************
*** 723,728 ****
--- 723,731 ----
/* Define if you have the <wchar.h> header file. */
#undef HAVE_WCHAR_H
+ /* Define if you have the <wctype.h> header file. */
+ #undef HAVE_WCTYPE_H
+
/* Define if you have the m library (-lm). */
#undef HAVE_LIBM
Index: acinclude.m4
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/acinclude.m4,v
retrieving revision 1.197
diff -c -p -r1.197 acinclude.m4
*** acinclude.m4 2002/03/12 01:45:48 1.197
--- acinclude.m4 2002/03/12 02:37:52
*************** AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT,
*** 869,875 ****
dnl Sanity check for existence of ISO C99 headers for extended encoding.
AC_CHECK_HEADERS(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no)
! AC_CHECK_HEADER(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no)
dnl Only continue checking if the ISO C99 headers exist and support is on.
if test x"$ac_has_wchar_h" = xyes &&
--- 869,875 ----
dnl Sanity check for existence of ISO C99 headers for extended encoding.
AC_CHECK_HEADERS(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no)
! AC_CHECK_HEADERS(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no)
dnl Only continue checking if the ISO C99 headers exist and support is on.
if test x"$ac_has_wchar_h" = xyes &&