This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3] libstdc++/6072


Enables wchar_t specializations for solaris. Requirements for enabled
wchar_t are loosened a bit, and may impact other OSes. See:

libstdc++/10535
libstdc++/10041

tested x86/linux

2003-09-25  Brad Spencer  <spencer@infointeractive.com>

	PR libstdc++/6072
	* acinclude.m4: 
	* aclocal.m4: Regenerate.
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* crossconfig.m4: Add in wchar_t bits for solaris crosses.
	* config/io/basic_file_stdio.cc: Guard unistd.h.
	* include/c_compatibility/wchar.h: Guard extra wchar_t functionality.
	* include/c_std/std_cwchar.h: Same.
	* include/c_std/std_cwctype.h: Same.

Index: acinclude.m4
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/acinclude.m4,v
retrieving revision 1.271
diff -c -p -r1.271 acinclude.m4
*** acinclude.m4	18 Sep 2003 14:27:19 -0000	1.271
--- acinclude.m4	25 Sep 2003 20:25:46 -0000
*************** AC_DEFUN(GLIBCXX_CHECK_WCHAR_T_SUPPORT, 
*** 383,394 ****
  
      # Checks for names injected into std:: by the c_std headers.
      AC_CHECK_FUNCS([btowc wctob fgetwc fgetws fputwc fputws fwide \
!     fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
!     vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
!     mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
      wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
      wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr],
      [],[ac_wfuncs=no])
  
      AC_MSG_CHECKING([for ISO C99 wchar_t support])
      if test x"$has_weof" = xyes &&
--- 383,399 ----
  
      # Checks for names injected into std:: by the c_std headers.
      AC_CHECK_FUNCS([btowc wctob fgetwc fgetws fputwc fputws fwide \
!     fwprintf fwscanf swprintf swscanf vfwprintf vswprintf \
!     vwprintf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
!     mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstol \
      wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
      wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr],
      [],[ac_wfuncs=no])
+ 
+     # Checks for wide character functions that are not required
+     # for basic wchar_t support.  Don't disable support if they are missing.
+     # Injection of these is wrapped with guard macros.
+     AC_CHECK_FUNCS([vfwscanf vswscanf vwscanf wcstof iswblank],[],[])
  
      AC_MSG_CHECKING([for ISO C99 wchar_t support])
      if test x"$has_weof" = xyes &&
Index: crossconfig.m4
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/crossconfig.m4,v
retrieving revision 1.2
diff -c -p -r1.2 crossconfig.m4
*** crossconfig.m4	20 Aug 2003 03:32:00 -0000	1.2
--- crossconfig.m4	25 Sep 2003 20:25:47 -0000
*************** case "${host}" in
*** 208,224 ****
      AC_DEFINE(HAVE_SINHL)
      ;;
    *-solaris*)
!     #case "$target" in
      #  *-solaris2.5)
      #    os_include_dir="os/solaris/solaris2.5"
      #    ;;
      #  *-solaris2.6)
      #    os_include_dir="os/solaris/solaris2.6"
      #    ;;
!     #  *-solaris2.7 | *-solaris2.8 | *-solaris2.9)
!     #    os_include_dir="os/solaris/solaris2.7"
!     #    ;;
!     #esac
      AC_DEFINE(HAVE_STRTOF)
      AC_DEFINE(HAVE_STRTOLD)
      AC_DEFINE(HAVE_MMAP) 
--- 208,327 ----
      AC_DEFINE(HAVE_SINHL)
      ;;
    *-solaris*)
!     case "$target" in
      #  *-solaris2.5)
      #    os_include_dir="os/solaris/solaris2.5"
      #    ;;
      #  *-solaris2.6)
      #    os_include_dir="os/solaris/solaris2.6"
      #    ;;
!       *-solaris2.7 | *-solaris2.8 | *-solaris2.9 | *-solaris2.10)
!          AC_DEFINE(HAVE_GETPAGESIZE)
!          AC_DEFINE(HAVE_SIGSETJMP)
!          AC_DEFINE(HAVE_MBSTATE_T)
!          AC_DEFINE(HAVE_POLL)
!          AC_DEFINE(HAVE_S_ISREG)
!          AC_DEFINE(HAVE_LC_MESSAGES)
!          AC_DEFINE(HAVE_BTOWC)
!          AC_DEFINE(HAVE_DRAND48)
!          AC_DEFINE(HAVE_FGETWC)
!          AC_DEFINE(HAVE_FGETWS)
!          AC_DEFINE(HAVE_FINITE)
!          AC_DEFINE(HAVE_FPCLASS)
!          AC_DEFINE(HAVE_FPUTWC)
!          AC_DEFINE(HAVE_FPUTWS)
!          AC_DEFINE(HAVE_FWIDE)
!          AC_DEFINE(HAVE_FWPRINTF)
!          AC_DEFINE(HAVE_FWSCANF)
!          AC_DEFINE(HAVE_GETPAGESIZE)
!          AC_DEFINE(HAVE_GETWC)
!          AC_DEFINE(HAVE_GETWCHAR)
!          AC_DEFINE(HAVE_ISATTY)
!          AC_DEFINE(HAVE_MBRLEN)
!          AC_DEFINE(HAVE_MBRTOWC)
!          AC_DEFINE(HAVE_MBSINIT)
!          AC_DEFINE(HAVE_MBSRTOWCS)
!          AC_DEFINE(HAVE_NL_LANGINFO)
!          AC_DEFINE(HAVE_PUTWC)
!          AC_DEFINE(HAVE_PUTWCHAR)
!          AC_DEFINE(HAVE_SWPRINTF)
!          AC_DEFINE(HAVE_SWSCANF)
!          AC_DEFINE(HAVE_UNGETWC)
!          AC_DEFINE(HAVE_VFWPRINTF)
!          AC_DEFINE(HAVE_VSWPRINTF)
!          AC_DEFINE(HAVE_VWPRINTF)
!          AC_DEFINE(HAVE_WCRTOMB)
!          AC_DEFINE(HAVE_WCSCAT)
!          AC_DEFINE(HAVE_WCSCHR)
!          AC_DEFINE(HAVE_WCSCMP)
!          AC_DEFINE(HAVE_WCSCOLL)
!          AC_DEFINE(HAVE_WCSCPY)
!          AC_DEFINE(HAVE_WCSCSPN)
!          AC_DEFINE(HAVE_WCSFTIME)
!          AC_DEFINE(HAVE_WCSLEN)
!          AC_DEFINE(HAVE_WCSNCAT)
!          AC_DEFINE(HAVE_WCSNCMP)
!          AC_DEFINE(HAVE_WCSNCPY)
!          AC_DEFINE(HAVE_WCSPBRK)
!          AC_DEFINE(HAVE_WCSRCHR)
!          AC_DEFINE(HAVE_WCSRTOMBS)
!          AC_DEFINE(HAVE_WCSSPN)
!          AC_DEFINE(HAVE_WCSSTR)
!          AC_DEFINE(HAVE_WCSTOD)
!          AC_DEFINE(HAVE_WCSTOK)
!          AC_DEFINE(HAVE_WCSTOL)
!          AC_DEFINE(HAVE_WCSTOUL)
!          AC_DEFINE(HAVE_WCSXFRM)
!          AC_DEFINE(HAVE_WCTOB)
!          AC_DEFINE(HAVE_WMEMCHR)
!          AC_DEFINE(HAVE_WMEMCMP)
!          AC_DEFINE(HAVE_WMEMCPY)
!          AC_DEFINE(HAVE_WMEMMOVE)
!          AC_DEFINE(HAVE_WMEMSET)
!          AC_DEFINE(HAVE_WPRINTF)
!          AC_DEFINE(HAVE_WSCANF)
!          AC_DEFINE(HAVE_ICONV)
!          AC_DEFINE(HAVE_ICONV_CLOSE)
!          AC_DEFINE(HAVE_ICONV_OPEN)
!          # Look for the pieces required for wchar_t support in order to
!          # get all the right HAVE_* macros defined.
!          GLIBCXX_CHECK_WCHAR_T_SUPPORT
!          # All of the dependencies for wide character support are here, so
!          # turn it on.  This requires some syncronization with the
!          # GLIBCXX_CHECK_WCHAR_T_SUPPORT in acinclude.m4
!          AC_DEFINE(_GLIBCXX_USE_WCHAR_T) 
!          # Are these tested for even when cross?
!          AC_DEFINE(HAVE_FLOAT_H)
!          AC_DEFINE(HAVE_IEEEFP_H)
!          AC_DEFINE(HAVE_INTTYPES_H)
!          AC_DEFINE(HAVE_LOCALE_H)
!          AC_DEFINE(HAVE_NAN_H)
!          AC_DEFINE(HAVE_SYS_FILIO_H)
!          AC_DEFINE(HAVE_SYS_IOCTL_H)
!          AC_DEFINE(HAVE_SYS_ISA_DEFS_H)
!          AC_DEFINE(HAVE_SYS_RESOURCE_H)
!          AC_DEFINE(HAVE_SYS_TIME_H)
!          AC_DEFINE(HAVE_SYS_TYPES_H)
!          AC_DEFINE(HAVE_UNISTD_H)
!          AC_DEFINE(HAVE_WCHAR_H)
!          AC_DEFINE(HAVE_WCTYPE_H)
!          AC_DEFINE(HAVE_LIBM)
!         ;;
!     esac
!     case "$target" in
!       sparc*-*-solaris2.8 | sparc*-*-solaris2.9 | sparc*-*-solaris2.10)
!         # I saw these on sparc-sun-solaris2.8, but not 2.6, and not on i386
!         AC_DEFINE(HAVE___BUILTIN_ABS)
!         AC_DEFINE(HAVE___BUILTIN_LABS)
!         AC_DEFINE(HAVE___BUILTIN_FABS)
!         AC_DEFINE(HAVE___BUILTIN_FABSF)
!         AC_DEFINE(HAVE___BUILTIN_FABSL)
!         AC_DEFINE(HAVE___BUILTIN_COS)
!         AC_DEFINE(HAVE___BUILTIN_COSF)
!         AC_DEFINE(HAVE___BUILTIN_SIN)
!         AC_DEFINE(HAVE___BUILTIN_SINF)
!        ;;
!     esac
      AC_DEFINE(HAVE_STRTOF)
      AC_DEFINE(HAVE_STRTOLD)
      AC_DEFINE(HAVE_MMAP) 
Index: config/io/basic_file_stdio.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/io/basic_file_stdio.cc,v
retrieving revision 1.19
diff -c -p -r1.19 basic_file_stdio.cc
*** config/io/basic_file_stdio.cc	18 Sep 2003 14:02:46 -0000	1.19
--- config/io/basic_file_stdio.cc	25 Sep 2003 20:25:47 -0000
***************
*** 33,53 ****
  
  #include <bits/basic_file.h>
  #include <fcntl.h>
- #include <unistd.h>
  #include <errno.h>
  
  #ifdef _GLIBCXX_HAVE_SYS_IOCTL_H
! #define BSD_COMP /* Get FIONREAD on Solaris2. */
  #include <sys/ioctl.h>
  #endif
  
  // Pick up FIONREAD on Solaris 2.5.
  #ifdef _GLIBCXX_HAVE_SYS_FILIO_H
  #include <sys/filio.h>
- #endif
- 
- #ifdef _GLIBCXX_HAVE_POLL
- #include <poll.h>
  #endif
  
  #ifdef _GLIBCXX_HAVE_SYS_UIO_H
--- 33,58 ----
  
  #include <bits/basic_file.h>
  #include <fcntl.h>
  #include <errno.h>
  
+ #ifdef _GLIBCXX_HAVE_POLL
+ #include <poll.h>
+ #endif
+ 
+ // Pick up ioctl on Solaris 2.8
+ #ifdef _GLIBCXX_HAVE_UNISTD_H
+ #include <unistd.h>
+ #endif
+ 
+ // Pick up FIONREAD on Solaris 2
  #ifdef _GLIBCXX_HAVE_SYS_IOCTL_H
! #define BSD_COMP 
  #include <sys/ioctl.h>
  #endif
  
  // Pick up FIONREAD on Solaris 2.5.
  #ifdef _GLIBCXX_HAVE_SYS_FILIO_H
  #include <sys/filio.h>
  #endif
  
  #ifdef _GLIBCXX_HAVE_SYS_UIO_H
Index: include/c_compatibility/wchar.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/c_compatibility/wchar.h,v
retrieving revision 1.2
diff -c -p -r1.2 wchar.h
*** include/c_compatibility/wchar.h	5 Jul 2003 04:05:36 -0000	1.2
--- include/c_compatibility/wchar.h	25 Sep 2003 20:25:47 -0000
***************
*** 1,6 ****
  // -*- C++ -*- compatibility header.
  
! // Copyright (C) 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
--- 1,6 ----
  // -*- C++ -*- compatibility header.
  
! // Copyright (C) 2002, 2003 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
*************** using std::fwscanf;
*** 50,60 ****
--- 50,66 ----
  using std::swprintf;
  using std::swscanf;
  using std::vfwprintf;
+ #if _GLIBCXX_HAVE_VFWSCANF
  using std::vfwscanf;
+ #endif 
  using std::vswprintf;
+ #if _GLIBCXX_HAVE_VSWSCANF
  using std::vswscanf;
+ #endif 
  using std::vwprintf;
+ #if _GLIBCXX_HAVE_VWSCANF
  using std::vwscanf;
+ #endif 
  using std::wprintf;
  using std::wscanf;
  using std::getwc;
*************** using std::putwchar;
*** 69,75 ****
--- 75,83 ----
  using std::ungetwc;
  using std::wcrtomb;
  using std::wcstod;
+ #if _GLIBCXX_HAVE_WCSTOF
  using std::wcstof;
+ #endif 
  using std::wcstol;
  using std::wcstoul;
  using std::wcscpy;
Index: include/c_std/std_cwchar.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/c_std/std_cwchar.h,v
retrieving revision 1.7
diff -c -p -r1.7 std_cwchar.h
*** include/c_std/std_cwchar.h	23 Jul 2003 15:28:44 -0000	1.7
--- include/c_std/std_cwchar.h	25 Sep 2003 20:25:47 -0000
*************** namespace std 
*** 92,102 ****
  #undef swscanf
  #undef ungetwc
  #undef vfwprintf
! #undef vfwscanf
  #undef vswprintf
! #undef vswscanf
  #undef vwprintf
! #undef vwscanf
  #undef wcrtomb
  #undef wcscat
  #undef wcschr
--- 92,108 ----
  #undef swscanf
  #undef ungetwc
  #undef vfwprintf
! #if _GLIBCXX_HAVE_VFWSCANF
! # undef vfwscanf
! #endif 
  #undef vswprintf
! #if _GLIBCXX_HAVE_VSWSCANF
! # undef vswscanf
! #endif 
  #undef vwprintf
! #if _GLIBCXX_HAVE_VWSCANF
! # undef vwscanf
! #endif 
  #undef wcrtomb
  #undef wcscat
  #undef wcschr
*************** namespace std 
*** 115,121 ****
  #undef wcsspn
  #undef wcsstr
  #undef wcstod
! #undef wcstof
  #undef wcstok
  #undef wcstol
  #undef wcstoul
--- 121,129 ----
  #undef wcsspn
  #undef wcsstr
  #undef wcstod
! #if _GLIBCXX_HAVE_WCSTOF
! # undef wcstof
! #endif 
  #undef wcstok
  #undef wcstol
  #undef wcstoul
*************** namespace std
*** 154,164 ****
--- 162,178 ----
    using ::swscanf;
    using ::ungetwc;
    using ::vfwprintf;
+ #if _GLIBCXX_HAVE_VFWSCANF
    using ::vfwscanf;
+ #endif 
    using ::vswprintf;
+ #if _GLIBCXX_HAVE_VSWSCANF
    using ::vswscanf;
+ #endif 
    using ::vwprintf;
+ #if _GLIBCXX_HAVE_VWSCANF
    using ::vwscanf;
+ #endif 
    using ::wcrtomb;
    using ::wcscat;
    using ::wcscmp;
*************** namespace std
*** 173,179 ****
--- 187,195 ----
    using ::wcsrtombs;
    using ::wcsspn;
    using ::wcstod;
+ #if _GLIBCXX_HAVE_WCSTOF
    using ::wcstof;
+ #endif 
    using ::wcstok;
    using ::wcstol;
    using ::wcstoul;
Index: include/c_std/std_cwctype.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/c_std/std_cwctype.h,v
retrieving revision 1.7
diff -c -p -r1.7 std_cwctype.h
*** include/c_std/std_cwctype.h	23 Jul 2003 15:28:44 -0000	1.7
--- include/c_std/std_cwctype.h	25 Sep 2003 20:25:47 -0000
***************
*** 1,6 ****
  // -*- 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
--- 1,6 ----
  // -*- C++ -*- forwarding header.
  
! // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
  // Free Software Foundation, Inc.
  //
  // This file is part of the GNU ISO C++ Library.  This library is free
***************
*** 55,61 ****
  // Get rid of those macros defined in <wctype.h> in lieu of real functions.
  #undef iswalnum
  #undef iswalpha
! #undef iswblank
  #undef iswcntrl
  #undef iswdigit
  #undef iswgraph
--- 55,63 ----
  // Get rid of those macros defined in <wctype.h> in lieu of real functions.
  #undef iswalnum
  #undef iswalpha
! #if _GLIBCXX_HAVE_ISWBLANK
! # undef iswblank
! #endif 
  #undef iswcntrl
  #undef iswdigit
  #undef iswgraph
*************** namespace std
*** 83,89 ****
--- 85,93 ----
  
    using ::iswalnum;
    using ::iswalpha;
+ #if _GLIBCXX_HAVE_ISWBLANK
    using ::iswblank;
+ #endif 
    using ::iswcntrl;
    using ::iswdigit;
    using ::iswgraph;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]