V3 PATCH: IRIX ctype
Mark P Mitchell
mark@codesourcery.com
Thu Nov 2 18:25:00 GMT 2000
Here are the IRIX configury bits for ctype.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
Thu Nov 2 10:11:45 2000 Mark P Mitchell <mark@codesourcery.com>
* acinclude.m4 (GLIBCPP_CHECK_CTYPE_SUPPORT): Add support for IRIX.
* aclocal.m4: Regenerated.
* Makefile.in: Regenerated.
* libio/Makefile.in: Likewise.
* libmath/Makefile.in: Likewise.
* libsupc++/Makefile.in: Likewise.
* src/Makefile.in: Likewise.
* configure: Likewise.
* config/os/irix/bits/ctype_base.h: Revise.
* config/os/irix/bits/ctype_inline.h: Likewise.
* config/os/irix/bits/ctype_noninline.h: Likewise.
Index: acinclude.m4
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/acinclude.m4,v
retrieving revision 1.79
diff -c -p -r1.79 acinclude.m4
*** acinclude.m4 2000/11/01 21:38:31 1.79
--- acinclude.m4 2000/11/03 02:22:28
*************** AC_DEFUN(GLIBCPP_CHECK_CTYPE_SUPPORT, [
*** 953,958 ****
--- 953,974 ----
fi
fi
+ dnl Test for <ctype> functionality -- IRIX
+ if test $ctype_defualt ="yes"; then
+ AC_MSG_CHECKING([<ctype> for IRIX])
+ AC_TRY_COMPILE([#include <ctype.h>],
+ [int
+ foo (int a)
+ { return _U + _L + _N + _S + _P + _C + _B + _X + \
+ _A + _PR + _G + _BL;}], \
+ ctype_irix=yes, ctype_irix=no)
+ AC_MSG_RESULT($ctype_irix)
+ if test $ctype_irix = "yes"; then
+ ctype_include_dir="config/os/irix"
+ ctype_default=no
+ fi
+ fi
+
dnl Test for <ctype> functionality -- newlib
if test $ctype_default = "yes"; then
AC_MSG_CHECKING([<ctype> for newlib])
Index: config/os/irix/bits/ctype_base.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/config/os/irix/bits/ctype_base.h,v
retrieving revision 1.1
diff -c -p -r1.1 ctype_base.h
*** ctype_base.h 2000/10/07 18:39:05 1.1
--- ctype_base.h 2000/11/03 02:22:28
***************
*** 35,41 ****
struct ctype_base
{
! typedef unsigned char mask;
// Non-standard typedefs.
typedef int* __to_type;
--- 35,41 ----
struct ctype_base
{
! typedef unsigned int mask;
// Non-standard typedefs.
typedef int* __to_type;
Index: config/os/irix/bits/ctype_inline.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/config/os/irix/bits/ctype_inline.h,v
retrieving revision 1.1
diff -c -p -r1.1 ctype_inline.h
*** ctype_inline.h 2000/10/07 18:39:05 1.1
--- ctype_inline.h 2000/11/03 02:22:28
***************
*** 1,6 ****
// Locale support -*- C++ -*-
! // Copyright (C) 2000 Cygnus Solutions
//
// 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 ----
// Locale support -*- C++ -*-
! // Copyright (C) 2000 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
***************
*** 37,50 ****
bool
ctype<char>::
is(mask __m, char __c) const throw()
! { return (_M_table + 1)[(unsigned char)(__c)] & __m; }
const char*
ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const throw()
{
while (__low < __high)
! *__vec++ = (_M_table + 1)[(unsigned char)(*__low++)];
return __high;
}
--- 37,50 ----
bool
ctype<char>::
is(mask __m, char __c) const throw()
! { return (_M_table)[(unsigned char)(__c)] & __m; }
const char*
ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const throw()
{
while (__low < __high)
! *__vec++ = (_M_table)[(unsigned char)(*__low++)];
return __high;
}
***************
*** 52,58 ****
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const throw()
{
! while (__low < __high && !((_M_table + 1)[(unsigned char)(*__low)] & __m))
++__low;
return __low;
}
--- 52,58 ----
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const throw()
{
! while (__low < __high && !((_M_table)[(unsigned char)(*__low)] & __m))
++__low;
return __low;
}
Index: config/os/irix/bits/ctype_noninline.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/config/os/irix/bits/ctype_noninline.h,v
retrieving revision 1.1
diff -c -p -r1.1 ctype_noninline.h
*** ctype_noninline.h 2000/10/07 18:39:05 1.1
--- ctype_noninline.h 2000/11/03 02:22:28
***************
*** 32,45 ****
//
// Information as gleaned from /usr/include/ctype.h
-
- ctype_base::__to_type const& ctype<char>::_S_toupper = _toupper;
- ctype_base::__to_type const& ctype<char>::_S_tolower = _tolower;
- const ctype_base::mask* const& ctype<char>::_S_table = __ctype;
! #ifdef _GLIBCPP_USE_WCHAR_T
! ctype_base::__to_type const& ctype<wchar_t>::_S_toupper = _toupper;
! ctype_base::__to_type const& ctype<wchar_t>::_S_tolower = _tolower;
! const ctype_base::mask* const& ctype<wchar_t>::_S_table = __ctype;
! #endif
--- 32,76 ----
//
// Information as gleaned from /usr/include/ctype.h
! ctype<char>::ctype(const mask* __table = 0, bool __del = false,
! size_t __refs = 0)
! : _Ctype_nois<char>(__refs), _M_del(__table != 0 && __del),
! _M_toupper(NULL),
! _M_tolower(NULL),
! _M_ctable(NULL),
! _M_table(!__table
! ? (const mask*) (__libc_attr._ctype_tbl->_class + 1)
! : __table)
! { }
!
! char
! ctype<char>::do_toupper(char __c) const
! { return _toupper(__c); }
!
! const char*
! ctype<char>::do_toupper(char* __low, const char* __high) const
! {
! while (__low < __high)
! {
! *__low = do_toupper(*__low);
! ++__low;
! }
! return __high;
! }
!
! char
! ctype<char>::do_tolower(char __c) const
! { return _tolower(__c); }
!
! const char*
! ctype<char>::do_tolower(char* __low, const char* __high) const
! {
! while (__low < __high)
! {
! *__low = do_tolower(*__low);
! ++__low;
! }
! return __high;
! }
More information about the Gcc-patches
mailing list