Add Irix 5.2, 6.3 support.

2001-03-07  Alexandre Oliva  <aoliva@redhat.com>

	Add Irix 5.2, 6.3 support.
        * config/os/irix/bits: Renamed too...
        * config/os/irix/irix6.5/bits: this.
        * config/os/irix/irix5.2/bits: New, copied from irix6.5/bits.
        * config/os/irix/irix5.2/bits/ctype_base.h: Use _U, _L, _N,
        _X, _S, _P, _C and _B instead of IRIX-6.5 _IS* macros.
        * config/os/irix/irix5.2/bits/ctype_noninline.h
        (ctype<char>::ctype): Initialize _M_table with __ctype.
        * configure.target: Adjust.

From-SVN: r40294
This commit is contained in:
Alexandre Oliva 2001-03-07 18:35:46 +00:00 committed by Benjamin Kosnik
parent e92044c316
commit dd1f09c21c
12 changed files with 324 additions and 2 deletions

View File

@ -1,3 +1,15 @@
2001-03-07 Alexandre Oliva <aoliva@redhat.com>
Add Irix 5.2, 6.3 support.
* config/os/irix/bits: Renamed too...
* config/os/irix/irix6.5/bits: this.
* config/os/irix/irix5.2/bits: New, copied from irix6.5/bits.
* config/os/irix/irix5.2/bits/ctype_base.h: Use _U, _L, _N,
_X, _S, _P, _C and _B instead of IRIX-6.5 _IS* macros.
* config/os/irix/irix5.2/bits/ctype_noninline.h
(ctype<char>::ctype): Initialize _M_table with __ctype.
* configure.target: Adjust.
2001-03-06 Benjamin Kosnik <bkoz@redhat.com>
libstdc++/2181

View File

@ -0,0 +1,50 @@
// Low-level functions for atomic operations: IRIX version -*- C++ -*-
// Copyright (C) 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
#include <mutex.h>
typedef long _Atomic_word;
static inline _Atomic_word
__exchange_and_add (_Atomic_word* __mem, int __val)
{
return (_Atomic_word) test_then_add ((unsigned long*) __mem, __val);
}
static inline void
__atomic_add (_Atomic_word* __mem, int __val)
{
__exchange_and_add (__mem, __val);
}
#endif /* atomicity.h */

View File

@ -0,0 +1,55 @@
// Locale support -*- C++ -*-
// Copyright (C) 1997-1999, 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
//
// ISO C++ 14882: 22.1 Locales
//
// Information as gleaned from /usr/include/ctype.h on irix 5.2
struct ctype_base
{
// Non-standard typedefs.
typedef unsigned int* __to_type;
// NB: Offsets into ctype<char>::_M_table force a particular size
// on the mask type. Because of this, we don't use an enum.
typedef unsigned char mask;
static const mask upper = _U;
static const mask lower = _L;
static const mask alpha = _U | _L;
static const mask digit = _N;
static const mask xdigit = _X;
static const mask space = _S;
static const mask print = _U | _L | _N | _P | _B;
static const mask graph = _U | _L | _N | _P;
static const mask cntrl = _C;
static const mask punct = _P;
static const mask alnum = _U | _L | _N;
};

View File

@ -0,0 +1,72 @@
// Locale support -*- C++ -*-
// Copyright (C) 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
//
// ISO C++ 14882: 22.1 Locales
//
// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
// functions go in ctype.cc
bool
ctype<char>::
is(mask __m, char __c) const
{ return (_M_table)[__c] & __m; }
const char*
ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const
{
while (__low < __high)
*__vec++ = (_M_table)[*__low++];
return __high;
}
const char*
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && !((_M_table)[*__low] & __m))
++__low;
return __low;
}
const char*
ctype<char>::
scan_not(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && ((_M_table + 1)[*__low] & __m) != 0)
++__low;
return __low;
}

View File

@ -0,0 +1,71 @@
// Locale support -*- C++ -*-
// Copyright (C) 1997-1999, 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
//
// ISO C++ 14882: 22.1 Locales
//
// Information as gleaned from /usr/include/ctype.h
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_ctable(NULL),
_M_table(!__table ? __ctype : __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;
}

View File

@ -0,0 +1,58 @@
// Specific definitions for IRIX -*- C++ -*-
// Copyright (C) 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#ifndef _GLIBCPP_OS_DEFINES
#define _GLIBCPP_OS_DEFINES
/* System-specific #define, typedefs, corrections, etc, go here. This
file will come before all others. */
/* We need large file support. There are two ways to turn it on:
by defining either _LARGEFILE64_SOURCE or _SGI_SOURCE. However,
it does not actually work to define only the former, as then
<sys/stat.h> is invalid: `st_blocks' is defined to be a macro,
but then used as a field name. So, we have to turn on
_SGI_SOURCE. That only works if _POSIX_SOURCE is turned off,
so we have to explicitly turn it off. (Some of the libio C files
explicitly try to turn it on.) _SGI_SOURCE is actually turned on
implicitly via the command-line. */
#undef _POSIX_SOURCE
#define __off_t off_t
#define __off64_t off64_t
#define __ssize_t ssize_t
/* GCC does not use thunks on IRIX. */
#define _G_USING_THUNKS 0
#endif

View File

@ -84,8 +84,12 @@ case "${target_os}" in
linux* | gnu*)
os_include_dir="config/os/gnu-linux"
;;
irix6.5*)
os_include_dir="config/os/irix"
irix[1-6] | irix[1-5].* | irix6.[0-4])
# This is known to work on at least IRIX 5.2 and 6.3.
os_include_dir="config/os/irix/irix5.2"
;;
irix6.5)
os_include_dir="config/os/irix/irix6.5"
;;
netbsd*)
os_include_dir="config/os/bsd/netbsd"