From: dj Date: Fri, 12 Jan 2001 19:39:07 +0000 (+0000) Subject: * acinclude.m4 (GLIBCPP_CHECK_CTYPE_SUPPORT): check for DJGPP X-Git-Tag: upstream/4.9.2~96593 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=557a32f1d467bcd2b8497a1147dbaf64a0643214;p=platform%2Fupstream%2Flinaro-gcc.git * acinclude.m4 (GLIBCPP_CHECK_CTYPE_SUPPORT): check for DJGPP (LIB_AC_PROG_CXX): replace [/\\] with [\\/] to work around older bash bug. * aclocal.m4: regenerated. * configure.target: set os_include_dir to config/os/djgpp under DJGPP. * configure: regenerated. * config/os/djgpp, config/os/djgpp/bits: new directories. * config/os/djgpp/bits/ctype_base.h, config/os/djgpp/bits/ctype_inline.h, config/os/djgpp/bits/ctype_noninline.h, config/os/djgpp/bits/os_defines.h: new files. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38958 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 04ae960..859c72d 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,17 @@ +2001-01-12 Laurynas Biveinis + + * acinclude.m4 (GLIBCPP_CHECK_CTYPE_SUPPORT): check for DJGPP + (LIB_AC_PROG_CXX): replace [/\\] with [\\/] to work around older + bash bug. + * aclocal.m4: regenerated. + * configure.target: set os_include_dir to config/os/djgpp under DJGPP. + * configure: regenerated. + * config/os/djgpp, config/os/djgpp/bits: new directories. + * config/os/djgpp/bits/ctype_base.h, + config/os/djgpp/bits/ctype_inline.h, + config/os/djgpp/bits/ctype_noninline.h, + config/os/djgpp/bits/os_defines.h: new files. + 2001-01-11 Joseph S. Myers * include/c_std/bits/std_cstdio.h: Undef printf. diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index 66a0bcc..6516797 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -152,7 +152,7 @@ LIB_AC_PROG_CXX . [$]{glibcpp_basedir}/configure.host case [$]{glibcpp_basedir} in - /* | [A-Za-z]:[/\\]*) libgcj_flagbasedir=[$]{glibcpp_basedir} ;; + /* | [A-Za-z]:[\\/]*) libgcj_flagbasedir=[$]{glibcpp_basedir} ;; *) glibcpp_flagbasedir='[$](top_builddir)/'[$]{glibcpp_basedir} ;; esac @@ -953,6 +953,23 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE_SUPPORT, [ fi fi + dnl Test for functionality -- DJGPP + dnl FIXME: this test won't work if __dj_ENFORCE_FUNCTION_CALLS + dnl is defined. + if test $ctype_default = "yes"; then + AC_MSG_CHECKING([ for DJGPP]) + AC_TRY_COMPILE([#include ], + [int + foo (int a) + { return __dj_ctype_flags[0] + __dj_ctype_flags[1];}], \ + ctype_djgpp=yes, ctype_djgpp=no) + AC_MSG_RESULT($ctype_djgpp) + if test $ctype_djgpp = "yes"; then + ctype_include_dir="config/os/djgpp" + ctype_default=no + fi + fi + if test $ctype_default = "yes"; then ctype_include_dir="config/os/generic" AC_MSG_WARN("Using default ctype headers.") diff --git a/libstdc++-v3/aclocal.m4 b/libstdc++-v3/aclocal.m4 index 288f61d..b1f6705 100644 --- a/libstdc++-v3/aclocal.m4 +++ b/libstdc++-v3/aclocal.m4 @@ -164,7 +164,7 @@ LIB_AC_PROG_CXX . [$]{glibcpp_basedir}/configure.host case [$]{glibcpp_basedir} in - /* | [A-Za-z]:[/\\]*) libgcj_flagbasedir=[$]{glibcpp_basedir} ;; + /* | [A-Za-z]:[\\/]*) libgcj_flagbasedir=[$]{glibcpp_basedir} ;; *) glibcpp_flagbasedir='[$](top_builddir)/'[$]{glibcpp_basedir} ;; esac @@ -965,6 +965,23 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE_SUPPORT, [ fi fi + dnl Test for functionality -- DJGPP + dnl FIXME: this test won't work if __dj_ENFORCE_FUNCTION_CALLS + dnl is defined. + if test $ctype_default = "yes"; then + AC_MSG_CHECKING([ for DJGPP]) + AC_TRY_COMPILE([#include ], + [int + foo (int a) + { return __dj_ctype_flags[0] + __dj_ctype_flags[1];}], \ + ctype_djgpp=yes, ctype_djgpp=no) + AC_MSG_RESULT($ctype_djgpp) + if test $ctype_djgpp = "yes"; then + ctype_include_dir="config/os/djgpp" + ctype_default=no + fi + fi + if test $ctype_default = "yes"; then ctype_include_dir="config/os/generic" AC_MSG_WARN("Using default ctype headers.") diff --git a/libstdc++-v3/config/os/djgpp/bits/ctype_base.h b/libstdc++-v3/config/os/djgpp/bits/ctype_base.h new file mode 100644 index 0000000..1c41fbd --- /dev/null +++ b/libstdc++-v3/config/os/djgpp/bits/ctype_base.h @@ -0,0 +1,58 @@ +// Locale support -*- C++ -*- + +// 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 +// 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 +// + + struct ctype_base + { + typedef unsigned short mask; + + // Non-standard typedefs. + typedef unsigned char __to_type; + + enum + { + space = __dj_ISSPACE, // Whitespace + print = __dj_ISPRINT, // Printing + cntrl = __dj_ISCNTRL, // Control character + upper = __dj_ISUPPER, // UPPERCASE + lower = __dj_ISLOWER, // lowercase + alpha = __dj_ISALPHA, // Alphabetic + digit = __dj_ISDIGIT, // Numeric + punct = __dj_ISPUNCT, // Punctuation + xdigit = __dj_ISXDIGIT, // Hexadecimal numeric + alnum = __dj_ISAL, // Alphanumeric + graph = __dj_ISGRAPH // Graphical + }; + }; + + + diff --git a/libstdc++-v3/config/os/djgpp/bits/ctype_inline.h b/libstdc++-v3/config/os/djgpp/bits/ctype_inline.h new file mode 100644 index 0000000..52ec0d6 --- /dev/null +++ b/libstdc++-v3/config/os/djgpp/bits/ctype_inline.h @@ -0,0 +1,67 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 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 +// 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:: + is(mask __m, char __c) const throw() + { return _M_table[(unsigned char)(__c + 1)] & __m; } + + const char* + ctype:: + is(const char* __low, const char* __high, mask* __vec) const throw() + { + while (__low < __high) + *__vec++ = _M_table[(unsigned char)(*__low++)]; + return __high; + } + + const char* + ctype:: + scan_is(mask __m, const char* __low, const char* __high) const throw() + { + while (__low < __high && !this->is(__m, *__low)) + ++__low; + return __low; + } + + const char* + ctype:: + scan_not(mask __m, const char* __low, const char* __high) const throw() + { + while (__low < __high && this->is(__m, *__low) != 0) + ++__low; + return __low; + } diff --git a/libstdc++-v3/config/os/djgpp/bits/ctype_noninline.h b/libstdc++-v3/config/os/djgpp/bits/ctype_noninline.h new file mode 100644 index 0000000..d13f987 --- /dev/null +++ b/libstdc++-v3/config/os/djgpp/bits/ctype_noninline.h @@ -0,0 +1,79 @@ +// Locale support -*- C++ -*- + +// 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 +// 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 DJGPP + +// DJGPP specific code +extern unsigned short __dj_type_cflags[]; +extern unsigned char __dj_ctype_toupper[]; +extern unsigned char __dj_ctype_tolower[]; + + ctype::ctype(const mask* __table = 0, bool __del = false, + size_t __refs = 0) + : _Ctype_nois(__refs), + _M_del(__table != 0 && __del), + _M_toupper(__dj_ctype_toupper), + _M_tolower(__dj_ctype_tolower), + _M_ctable(NULL), + _M_table(__table == 0 ? __dj_type_cflags : __table) + { } + + char + ctype::do_toupper(char __c) const + { return _M_toupper[(int)(__c)+1]) } + + const char* + ctype::do_toupper(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = ::toupper((int) *__low); + ++__low; + } + return __high; + } + + char + ctype::do_tolower(char __c) const + { return _M_tolower[(int)(__c)+1]) } + + const char* + ctype::do_tolower(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = ::tolower((int) *__low); + ++__low; + } + return __high; + } diff --git a/libstdc++-v3/config/os/djgpp/bits/os_defines.h b/libstdc++-v3/config/os/djgpp/bits/os_defines.h new file mode 100644 index 0000000..f979b1e --- /dev/null +++ b/libstdc++-v3/config/os/djgpp/bits/os_defines.h @@ -0,0 +1,44 @@ +// Specific definitions for DJGPP -*- 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. */ + +#define __off_t off_t +#define __off64_t off64_t +#define __ssize_t ssize_t + +// FIXME: should there be '#undef POSIX_SOURCE'? + +#endif diff --git a/libstdc++-v3/configure.target b/libstdc++-v3/configure.target index 089e079..1153863 100644 --- a/libstdc++-v3/configure.target +++ b/libstdc++-v3/configure.target @@ -87,6 +87,9 @@ case "${target_os}" in cygwin*) os_include_dir="config/os/newlib" ;; + *djgpp*) + os_include_dir="config/os/djgpp" + ;; linux* | gnu*) os_include_dir="config/os/gnu-linux" ;;