Gcc 3.3.1-pre 2003-07-11 C++ support bits.

This commit is contained in:
Alexander Kabaev 2003-07-11 03:42:04 +00:00
parent bd0df3aa27
commit 1b86b14eac
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/vendor/gcc/dist/; revision=117397
220 changed files with 51489 additions and 12496 deletions

File diff suppressed because it is too large Load Diff

View File

@ -29,6 +29,8 @@ SUBDIRS = include libio libmath libsupc++ src po testsuite
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
PWD_COMMAND = $${PWDCMD-pwd}
# These two special 'check-script' rules use the bash script 'mkcheck'
# to do testing. This script is not as portable as the dejagnu test
# harness, and is thus off by default. It does produce interesting
@ -44,42 +46,22 @@ check-script-install: $(top_builddir)/mkcheck
cd testsuite; \
@glibcpp_builddir@/mkcheck 1)
# Use 'new-abi-baseline' to create an initial symbol file. Then run
# 'check-abi' to test for changes against that file.
baseline_file = @baseline_file@
check-abi: $(top_builddir)/testsuite/abi_check
-@(cd testsuite; \
@glibcpp_srcdir@/config/abi/extract_symvers \
../src/.libs/libstdc++.so \
./current_symbols.txt; \
./abi_check --check ./current_symbols.txt ${baseline_file})
new-abi-baseline:
-@(output=${baseline_file}; \
if test -f $${output}; then \
output=$${output}.new; \
t=`echo $${output} | sed 's=.*config/abi/=='`; \
echo "Baseline file already exists, writing to $${t} instead."; \
fi; \
@glibcpp_srcdir@/config/abi/extract_symvers \
src/.libs/libstdc++.so $${output})
# These rules are messy, but are hella worth it.
doxygen:
-(srcdir=`cd ${top_srcdir}; pwd`; \
builddir=`pwd`; \
-(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
builddir=`${PWD_COMMAND}`; \
/bin/sh ${srcdir}/docs/doxygen/run_doxygen \
--mode=user $${srcdir} $${builddir})
doxygen-maint:
-(srcdir=`cd ${top_srcdir}; pwd`; \
builddir=`pwd`; \
-(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
builddir=`${PWD_COMMAND}`; \
/bin/sh ${srcdir}/docs/doxygen/run_doxygen \
--mode=maint $${srcdir} $${builddir})
doxygen-man:
-(srcdir=`cd ${top_srcdir}; pwd`; \
builddir=`pwd`; \
-(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
builddir=`${PWD_COMMAND}`; \
/bin/sh ${srcdir}/docs/doxygen/run_doxygen \
--mode=man $${srcdir} $${builddir})
@ -154,6 +136,7 @@ AM_MAKEFLAGS = \
"includedir=$(includedir)" \
"prefix=$(prefix)" \
"tooldir=$(tooldir)" \
"gxx_include_dir=$(gxx_include_dir)" \
"AR=$(AR)" \
"AS=$(AS)" \
"LD=$(LD)" \
@ -165,3 +148,6 @@ AM_MAKEFLAGS = \
"NM_FOR_TARGET=$(NM_FOR_TARGET)" \
"DESTDIR=$(DESTDIR)" \
"WERROR=$(WERROR)"
# Subdir rules rely on $(FLAGS_TO_PASS)
FLAGS_TO_PASS = $(AM_MAKEFLAGS)

View File

@ -1,4 +1,4 @@
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
@ -67,15 +67,24 @@ AR = @AR@
AS = @AS@
ATOMICITY_INC_SRCDIR = @ATOMICITY_INC_SRCDIR@
AWK = @AWK@
BASIC_FILE_CC = @BASIC_FILE_CC@
BASIC_FILE_H = @BASIC_FILE_H@
CC = @CC@
CCODECVT_C = @CCODECVT_C@
CCODECVT_CC = @CCODECVT_CC@
CCODECVT_H = @CCODECVT_H@
CCOLLATE_CC = @CCOLLATE_CC@
CCTYPE_CC = @CCTYPE_CC@
CLOCALE_CC = @CLOCALE_CC@
CLOCALE_H = @CLOCALE_H@
CLOCALE_INTERNAL_H = @CLOCALE_INTERNAL_H@
CMESSAGES_CC = @CMESSAGES_CC@
CMESSAGES_H = @CMESSAGES_H@
CMONEY_CC = @CMONEY_CC@
CNUMERIC_CC = @CNUMERIC_CC@
CPP = @CPP@
CPU_LIMITS_INC_SRCDIR = @CPU_LIMITS_INC_SRCDIR@
CSTDIO_H = @CSTDIO_H@
CTIME_CC = @CTIME_CC@
CTIME_H = @CTIME_H@
CXX = @CXX@
CXXCPP = @CXXCPP@
@ -108,11 +117,13 @@ RANLIB = @RANLIB@
SECTION_FLAGS = @SECTION_FLAGS@
SECTION_LDFLAGS = @SECTION_LDFLAGS@
STRIP = @STRIP@
SYMVER_MAP = @SYMVER_MAP@
TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
WARN_FLAGS = @WARN_FLAGS@
WERROR = @WERROR@
baseline_dir = @baseline_dir@
check_msgfmt = @check_msgfmt@
enable_shared = @enable_shared@
enable_static = @enable_static@
@ -140,9 +151,7 @@ SUBDIRS = include libio libmath libsupc++ src po testsuite
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
# Use 'new-abi-baseline' to create an initial symbol file. Then run
# 'check-abi' to test for changes against that file.
baseline_file = @baseline_file@
PWD_COMMAND = $${PWDCMD-pwd}
# Multilib support.
MAKEOVERRIDES =
@ -185,6 +194,7 @@ AM_MAKEFLAGS = \
"includedir=$(includedir)" \
"prefix=$(prefix)" \
"tooldir=$(tooldir)" \
"gxx_include_dir=$(gxx_include_dir)" \
"AR=$(AR)" \
"AS=$(AS)" \
"LD=$(LD)" \
@ -197,6 +207,9 @@ AM_MAKEFLAGS = \
"DESTDIR=$(DESTDIR)" \
"WERROR=$(WERROR)"
# Subdir rules rely on $(FLAGS_TO_PASS)
FLAGS_TO_PASS = $(AM_MAKEFLAGS)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES = mkcheck testsuite_flags
@ -270,7 +283,7 @@ testsuite_flags: $(top_builddir)/config.status testsuite_flags.in
all-recursive install-data-recursive install-exec-recursive \
installdirs-recursive install-recursive uninstall-recursive install-info-recursive \
check-recursive installcheck-recursive info-recursive dvi-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
@set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
@ -290,7 +303,7 @@ check-recursive installcheck-recursive info-recursive dvi-recursive:
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
@set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
@ -482,39 +495,23 @@ check-script-install: $(top_builddir)/mkcheck
-(chmod + $(top_builddir)/mkcheck; \
cd testsuite; \
@glibcpp_builddir@/mkcheck 1)
check-abi: $(top_builddir)/testsuite/abi_check
-@(cd testsuite; \
@glibcpp_srcdir@/config/abi/extract_symvers \
../src/.libs/libstdc++.so \
./current_symbols.txt; \
./abi_check --check ./current_symbols.txt ${baseline_file})
new-abi-baseline:
-@(output=${baseline_file}; \
if test -f $${output}; then \
output=$${output}.new; \
t=`echo $${output} | sed 's=.*config/abi/=='`; \
echo "Baseline file already exists, writing to $${t} instead."; \
fi; \
@glibcpp_srcdir@/config/abi/extract_symvers \
src/.libs/libstdc++.so $${output})
# These rules are messy, but are hella worth it.
doxygen:
-(srcdir=`cd ${top_srcdir}; pwd`; \
builddir=`pwd`; \
-(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
builddir=`${PWD_COMMAND}`; \
/bin/sh ${srcdir}/docs/doxygen/run_doxygen \
--mode=user $${srcdir} $${builddir})
doxygen-maint:
-(srcdir=`cd ${top_srcdir}; pwd`; \
builddir=`pwd`; \
-(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
builddir=`${PWD_COMMAND}`; \
/bin/sh ${srcdir}/docs/doxygen/run_doxygen \
--mode=maint $${srcdir} $${builddir})
doxygen-man:
-(srcdir=`cd ${top_srcdir}; pwd`; \
builddir=`pwd`; \
-(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
builddir=`${PWD_COMMAND}`; \
/bin/sh ${srcdir}/docs/doxygen/run_doxygen \
--mode=man $${srcdir} $${builddir})

View File

@ -135,6 +135,15 @@
// Define if the compiler/host combination has __builtin_sqrtl
#undef HAVE___BUILTIN_SQRTL
// Define if poll is available in <poll.h>.
#undef HAVE_POLL
// Define if S_ISREG (Posix) is available in <sys/stat.h>.
#undef HAVE_S_ISREG
// Define if S_IFREG is available in <sys/stat.h>.
#undef HAVE_S_IFREG
// Define if LC_MESSAGES is available in <locale.h>.
#undef HAVE_LC_MESSAGES

View File

@ -1,5 +1,5 @@
dnl
dnl Initialize configure bits.
dnl Initialize basic configure bits, set toplevel_srcdir for Makefiles.
dnl
dnl GLIBCPP_TOPREL_CONFIGURE
AC_DEFUN(GLIBCPP_TOPREL_CONFIGURE, [
@ -37,13 +37,10 @@ AC_DEFUN(GLIBCPP_TOPREL_CONFIGURE, [
])
dnl
dnl Initialize configure bits.
dnl Initialize the rest of the library configury.
dnl
dnl GLIBCPP_CONFIGURE
AC_DEFUN(GLIBCPP_CONFIGURE, [
#possibly test for the presence of the compiler sources here?
# Export build and source directories.
# These need to be absolute paths, yet at the same time need to
# canonicalize only relative paths, because then amd will not unmount
@ -270,8 +267,7 @@ AC_DEFUN(GLIBCPP_CHECK_COMPILER_FEATURES, [
# this is the suspicious part
CXXFLAGS=''
fi
if test x"$ac_fdsections" = x"yes" &&
test x"$enable_debug" = x"no"; then
if test x"$ac_fdsections" = x"yes"; then
SECTION_FLAGS='-ffunction-sections -fdata-sections'
fi
AC_MSG_RESULT($ac_fdsections)
@ -364,7 +360,7 @@ AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
fi
# Set linker optimization flags.
if test x"$with_gnu_ld" = x"yes" && test x"$enable_debug" = x"no"; then
if test x"$with_gnu_ld" = x"yes"; then
OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
fi
@ -732,7 +728,6 @@ AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT, [
fi
])
dnl
dnl Check to see what the underlying c library is like
dnl These checks need to do two things:
@ -748,7 +743,7 @@ dnl GLIBCPP_CHECK_STDLIB_SUPPORT
AC_DEFUN(GLIBCPP_CHECK_STDLIB_SUPPORT, [
ac_test_CXXFLAGS="${CXXFLAGS+set}"
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtold)
GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtof)
@ -790,7 +785,7 @@ dnl GLIBCPP_CHECK_MATH_SUPPORT
AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
ac_test_CXXFLAGS="${CXXFLAGS+set}"
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
dnl Check libm
AC_CHECK_LIB(m, sin, libm="-lm")
@ -915,7 +910,11 @@ AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
AC_CHECK_FUNCS([__signbitl], , [LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"])
fi
if test -n "$LIBMATHOBJS"; then
need_libmath=yes
fi
AC_SUBST(LIBMATHOBJS)
AM_CONDITIONAL(GLIBCPP_BUILD_LIBMATH, test "$need_libmath" = yes)
])
@ -925,9 +924,9 @@ dnl compilation, pick them up here.
dnl
dnl GLIBCPP_CHECK_TARGET
AC_DEFUN(GLIBCPP_CHECK_TARGET, [
. [$]{glibcpp_basedir}/configure.target
AC_MSG_RESULT(CPU config directory is $cpu_include_dir)
AC_MSG_RESULT(OS config directory is $os_include_dir)
. [$]{glibcpp_basedir}/configure.target
AC_MSG_RESULT(CPU config directory is $cpu_include_dir)
AC_MSG_RESULT(OS config directory is $os_include_dir)
])
@ -941,6 +940,8 @@ dnl Define HAVE_MBSTATE_T if mbstate_t is not in wchar.h
dnl
dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT
AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
dnl Wide characters disabled by default.
enable_wchar_t=no
dnl Test wchar.h for mbstate_t, which is needed for char_traits and
dnl others even if wchar_t support is not on.
@ -986,7 +987,7 @@ AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
ac_wfuncs=no)
dnl Checks for names injected into std:: by the c_std headers.
AC_CHECK_FUNCS(btowc wctob fgetwc fgetwc fgetws fputwc fputws fwide \
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 \
@ -1031,30 +1032,33 @@ AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
dnl At the moment, only enable wchar_t specializations if all the
dnl above support is present.
AC_MSG_CHECKING([for enabled wchar_t specializations])
if test x"$ac_isoC99_wchar_t" = xyes &&
test x"$ac_XPG2_wchar_t" = xyes; then
AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
AC_MSG_RESULT("yes")
else
AC_MSG_RESULT("no")
AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
enable_wchar_t=yes
fi
else
dnl Wide characters disabled by the user.
AC_MSG_WARN([wchar_t support disabled.])
fi
AC_MSG_CHECKING([for enabled wchar_t specializations])
AC_MSG_RESULT($enable_wchar_t)
AM_CONDITIONAL(GLIBCPP_TEST_WCHAR_T, test "$enable_wchar_t" = yes)
])
dnl
dnl Check for special debugging mode; not for production use.
dnl Check to see if debugging libraries are to be built.
dnl
dnl GLIBCPP_ENABLE_DEBUG
dnl --enable-debug sets '-ggdb3 -O0'.
dnl --disable-debug sets '-g' and whatever optimization options the
dnl compiler can handle.
dnl + --enable-maintainer-mode automatically defaults this to on.
dnl + Perhaps -D/-U of NDEBUG, DEBUG, DEBUG_ASSERT, ...?
dnl
dnl --enable-debug
dnl builds a separate set of debugging libraries in addition to the
dnl normal (shared, static) libstdc++ binaries.
dnl
dnl --disable-debug
dnl builds only one (non-debug) version of libstdc++.
dnl
dnl --enable-debug-flags=FLAGS
dnl iff --enable-debug == yes, then use FLAGS to build the debug library.
dnl
dnl + Usage: GLIBCPP_ENABLE_DEBUG[(DEFAULT)]
dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
dnl defaults to `no'.
@ -1062,7 +1066,7 @@ AC_DEFUN(GLIBCPP_ENABLE_DEBUG, [dnl
define([GLIBCPP_ENABLE_DEBUG_DEFAULT], ifelse($1, yes, yes, no))dnl
AC_ARG_ENABLE(debug,
changequote(<<, >>)dnl
<< --enable-debug extra debugging, turn off optimization [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT],
<< --enable-debug build extra debug library [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT],
changequote([, ])dnl
[case "${enableval}" in
yes) enable_debug=yes ;;
@ -1070,17 +1074,56 @@ changequote([, ])dnl
*) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;;
esac],
enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl
AC_MSG_CHECKING([for additional debug build])
AC_MSG_RESULT($enable_debug)
AM_CONDITIONAL(GLIBCPP_BUILD_DEBUG, test "$enable_debug" = yes)
])
dnl Check for explicit debug flags.
dnl
dnl GLIBCPP_ENABLE_DEBUG_FLAGS
dnl
dnl --enable-debug-flags='-O1'
dnl is a general method for passing flags to be used when
dnl building debug libraries with --enable-debug.
dnl
dnl --disable-debug-flags does nothing.
dnl + Usage: GLIBCPP_ENABLE_DEBUG_FLAGS(default flags)
dnl If "default flags" is an empty string (or "none"), the effect is
dnl the same as --disable or --enable=no.
AC_DEFUN(GLIBCPP_ENABLE_DEBUG_FLAGS, [dnl
define([GLIBCPP_ENABLE_DEBUG_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
AC_ARG_ENABLE(debug_flags,
changequote(<<, >>)dnl
<< --enable-debug-flags=FLAGS pass compiler FLAGS when building debug
library;[default=>>GLIBCPP_ENABLE_DEBUG_FLAGS_DEFAULT],
changequote([, ])dnl
[case "${enableval}" in
none) ;;
-*) enable_debug_flags="${enableval}" ;;
*) AC_MSG_ERROR([Unknown argument to extra debugging flags]) ;;
esac],
enable_debug_flags=GLIBCPP_ENABLE_DEBUG_FLAGS_DEFAULT)dnl
dnl Option parsed, now set things appropriately
case "${enable_debug}" in
yes)
DEBUG_FLAGS='-O0 -ggdb3'
;;
no)
DEBUG_FLAGS='-g'
case x"$enable_debug" in
xyes)
case "$enable_debug_flags" in
none)
DEBUG_FLAGS="-g3 -O0";;
-*) #valid input
DEBUG_FLAGS="${enableval}"
esac
;;
xno)
DEBUG_FLAGS=""
;;
esac
AC_SUBST(DEBUG_FLAGS)
AC_MSG_CHECKING([for debug build flags])
AC_MSG_RESULT($DEBUG_FLAGS)
])
@ -1101,39 +1144,36 @@ dnl If "default flags" is an empty string (or "none"), the effect is
dnl the same as --disable or --enable=no.
AC_DEFUN(GLIBCPP_ENABLE_CXX_FLAGS, [dnl
define([GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
AC_ARG_ENABLE(cxx-flags,
AC_MSG_CHECKING([for extra compiler flags for building])
AC_ARG_ENABLE(cxx_flags,
changequote(<<, >>)dnl
<< --enable-cxx-flags=FLAGS pass compiler FLAGS when building library;
[default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT],
[default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT],
changequote([, ])dnl
[case "x$enableval" in
xyes)
AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
xno|x)
enable_cxx_flags='' ;;
*)
enable_cxx_flags="$enableval" ;;
esac],
enable_cxx_flags='GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT')
dnl Thinko on my part during design. This kludge is the workaround.
if test "$enable_cxx_flags" = "none"; then
enable_cxx_flags='';
fi
[case "x$enable_cxx_flags" in
xyes)
AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
xno | xnone | x)
enable_cxx_flags='' ;;
*)
enable_cxx_flags="$enableval" ;;
esac],
enable_cxx_flags=GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT)
dnl Run through flags (either default or command-line) and set anything
dnl extra (e.g., #defines) that must accompany particular g++ options.
if test -n "$enable_cxx_flags"; then
for f in $enable_cxx_flags; do
case "$f" in
-fhonor-std) ;;
-*) ;;
*) # and we're trying to pass /what/ exactly?
AC_MSG_ERROR([compiler flags start with a -]) ;;
esac
done
for f in $enable_cxx_flags; do
case "$f" in
-fhonor-std) ;;
-*) ;;
*) # and we're trying to pass /what/ exactly?
AC_MSG_ERROR([compiler flags start with a -]) ;;
esac
done
fi
EXTRA_CXX_FLAGS="$enable_cxx_flags"
AC_MSG_RESULT($EXTRA_CXX_FLAGS)
AC_SUBST(EXTRA_CXX_FLAGS)
])
@ -1298,24 +1338,20 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
glibcpp_localedir=${glibcpp_builddir}/po/share/locale
AC_SUBST(glibcpp_localedir)
# For the time being, transform ctype_noninline.h to ctype_members_char.cc
# CCTYPE_CHAR_CC=config/${os_include_dir}/ctype_noninline.h
AC_SUBST(USE_NLS)
AC_SUBST(CLOCALE_H)
AC_SUBST(CCODECVT_H)
AC_SUBST(CMESSAGES_H)
AC_SUBST(CCODECVT_CC)
AC_SUBST(CCOLLATE_CC)
AC_SUBST(CCTYPE_CC)
AC_SUBST(CMESSAGES_CC)
AC_SUBST(CMONEY_CC)
AC_SUBST(CNUMERIC_CC)
AC_SUBST(CTIME_H)
AC_LINK_FILES($CLOCALE_CC, src/c++locale.cc)
AC_LINK_FILES($CCODECVT_CC, src/codecvt_members.cc)
AC_LINK_FILES($CCOLLATE_CC, src/collate_members.cc)
# AC_LINK_FILES($CCTYPE_CHAR_CC, src/ctype_members_char.cc)
AC_LINK_FILES($CCTYPE_CC, src/ctype_members.cc)
AC_LINK_FILES($CMESSAGES_CC, src/messages_members.cc)
AC_LINK_FILES($CMONEY_CC, src/monetary_members.cc)
AC_LINK_FILES($CNUMERIC_CC, src/numeric_members.cc)
AC_LINK_FILES($CTIME_CC, src/time_members.cc)
AC_LINK_FILES($CLOCALE_INTERNAL_H, src/c++locale_internal.h)
AC_SUBST(CTIME_CC)
AC_SUBST(CLOCALE_CC)
AC_SUBST(CLOCALE_INTERNAL_H)
])
@ -1416,7 +1452,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
esac
AC_SUBST(CSTDIO_H)
AC_SUBST(BASIC_FILE_H)
AC_LINK_FILES($BASIC_FILE_CC, src/basic_file.cc)
AC_SUBST(BASIC_FILE_CC)
# 2000-08-04 bkoz hack
CCODECVT_C=config/io/c_io_libio_codecvt.c
@ -1499,7 +1535,7 @@ void foo()
}
EOF
old_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="-S -fexceptions"
CXXFLAGS=-S
if AC_TRY_EVAL(ac_compile); then
if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
enable_sjlj_exceptions=yes
@ -1735,21 +1771,20 @@ AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
dnl
dnl Check for what kind of C headers to use.
dnl Check for what type of C headers to use.
dnl
dnl GLIBCPP_ENABLE_CHEADERS
dnl --enable-cheaders= [does stuff].
dnl --disable-cheaders [does not do anything, really].
dnl + This will eventually need to be 'c_shadow' by default.
dnl + Usage: GLIBCPP_ENABLE_CHEADERS[(DEFAULT)]
dnl Where DEFAULT is either `c' or `c_std' or 'c_shadow'.
dnl Where DEFAULT is either `c' or `c_std'.
dnl If ommitted, it defaults to `c_std'.
AC_DEFUN(GLIBCPP_ENABLE_CHEADERS, [dnl
define([GLIBCPP_ENABLE_CHEADERS_DEFAULT], ifelse($1, c_std, c_std, c_std))dnl
AC_MSG_CHECKING([for c header strategy to use])
AC_ARG_ENABLE(cheaders,
changequote(<<, >>)dnl
<< --enable-cheaders construct "C" header files for g++ [default=>>GLIBCPP_ENABLE_CHEADERS_DEFAULT],
<< --enable-cheaders=MODEL construct "C" header files for g++ [default=>>GLIBCPP_ENABLE_CHEADERS_DEFAULT],
changequote([, ])
[case "$enableval" in
c)
@ -1758,9 +1793,6 @@ changequote([, ])
c_std)
enable_cheaders=c_std
;;
c_shadow)
enable_cheaders=c_shadow
;;
*) AC_MSG_ERROR([Unknown argument to enable/disable "C" headers])
;;
esac],
@ -1769,9 +1801,6 @@ changequote([, ])
dnl Option parsed, now set things appropriately
case "$enable_cheaders" in
c_shadow)
C_INCLUDE_DIR='${glibcpp_srcdir}/include/c_shadow'
;;
c_std)
C_INCLUDE_DIR='${glibcpp_srcdir}/include/c_std'
;;
@ -1820,7 +1849,6 @@ dnl TOPLEVEL_INCLUDES
dnl LIBMATH_INCLUDES
dnl LIBSUPCXX_INCLUDES
dnl LIBIO_INCLUDES
dnl CSHADOW_INCLUDES
dnl
dnl GLIBCPP_EXPORT_INCLUDES
AC_DEFUN(GLIBCPP_EXPORT_INCLUDES, [
@ -1859,7 +1887,7 @@ AC_DEFUN(GLIBCPP_EXPORT_FLAGS, [
OPTIMIZE_CXXFLAGS=
AC_SUBST(OPTIMIZE_CXXFLAGS)
WARN_FLAGS='-Wall -Wno-format -W -Wwrite-strings -Winline'
WARN_FLAGS='-Wall -Wno-format -W -Wwrite-strings'
AC_SUBST(WARN_FLAGS)
])
@ -2041,8 +2069,9 @@ dnl string, '#' otherwise
dnl Check for headers for, and arguments to, the setrlimit() function.
dnl Used only in testsuite_hooks.h.
AC_DEFUN(GLIBCPP_CHECK_SETRLIMIT_ancilliary, [
AC_TRY_COMPILE([#include <sys/resource.h>
#include <unistd.h>
AC_TRY_COMPILE([#include <unistd.h>
#include <sys/time.h>
#include <sys/resource.h>
], [ int f = RLIMIT_$1 ; ],
[glibcpp_mresult=1], [glibcpp_mresult=0])
AC_DEFINE_UNQUOTED(HAVE_MEMLIMIT_$1, $glibcpp_mresult,
@ -2050,7 +2079,7 @@ AC_DEFUN(GLIBCPP_CHECK_SETRLIMIT_ancilliary, [
])
AC_DEFUN(GLIBCPP_CHECK_SETRLIMIT, [
setrlimit_have_headers=yes
AC_CHECK_HEADERS(sys/resource.h unistd.h,
AC_CHECK_HEADERS(unistd.h sys/time.h sys/resource.h,
[],
setrlimit_have_headers=no)
# If don't have the headers, then we can't run the tests now, and we
@ -2064,8 +2093,9 @@ AC_DEFUN(GLIBCPP_CHECK_SETRLIMIT, [
# Check for rlimit, setrlimit.
AC_CACHE_VAL(ac_setrlimit, [
AC_TRY_COMPILE([#include <sys/resource.h>
#include <unistd.h>
AC_TRY_COMPILE([#include <unistd.h>
#include <sys/time.h>
#include <sys/resource.h>
],
[ struct rlimit r; setrlimit(0, &r);],
[ac_setrlimit=yes], [ac_setrlimit=no])
@ -2089,18 +2119,30 @@ dnl the testsuite_hooks.h header.
dnl
dnl GLIBCPP_CONFIGURE_TESTSUITE [no args]
AC_DEFUN(GLIBCPP_CONFIGURE_TESTSUITE, [
GLIBCPP_CHECK_SETRLIMIT
if test x"$GLIBCPP_IS_CROSS_COMPILING" = xfalse; then
# Do checks for memory limit functions.
GLIBCPP_CHECK_SETRLIMIT
# Look for setenv, so that extended locale tests can be performed.
GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
# Look for setenv, so that extended locale tests can be performed.
GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
fi
# Export file names for ABI checking.
baseline_file="${glibcpp_srcdir}/config/abi/${abi_baseline_triplet}/baseline_symbols.txt"
AC_SUBST(baseline_file)
baseline_dir="${glibcpp_srcdir}/config/abi/${abi_baseline_pair}\$(MULTISUBDIR)"
AC_SUBST(baseline_dir)
# Don't do ABI checking unless native.
AM_CONDITIONAL(GLIBCPP_BUILD_ABI_CHECK,
test x"$build" = x"$host" && test -z "$with_cross_host")
# Determine if checking the ABI is desirable.
if test x$enable_symvers = xno; then
enable_abi_check=no
else
case "$host" in
*-*-cygwin*)
enable_abi_check=no ;;
*)
enable_abi_check=yes ;;
esac
fi
AM_CONDITIONAL(GLIBCPP_TEST_ABI, test "$enable_abi_check" = yes)
])
@ -2114,6 +2156,45 @@ AC_DEFUN([AC_LIBTOOL_DLOPEN])
AC_DEFUN([AC_PROG_LD])
])
dnl
dnl Check whether S_ISREG (Posix) or S_IFREG is available in <sys/stat.h>.
dnl
AC_DEFUN(GLIBCPP_CHECK_S_ISREG_OR_S_IFREG, [
AC_CACHE_VAL(glibcpp_cv_S_ISREG, [
AC_TRY_LINK([#include <sys/stat.h>],
[struct stat buffer; fstat(0, &buffer); S_ISREG(buffer.st_mode); ],
[glibcpp_cv_S_ISREG=yes],
[glibcpp_cv_S_ISREG=no])
])
AC_CACHE_VAL(glibcpp_cv_S_IFREG, [
AC_TRY_LINK([#include <sys/stat.h>],
[struct stat buffer; fstat(0, &buffer); S_IFREG & buffer.st_mode; ],
[glibcpp_cv_S_IFREG=yes],
[glibcpp_cv_S_IFREG=no])
])
if test x$glibcpp_cv_S_ISREG = xyes; then
AC_DEFINE(HAVE_S_ISREG)
elif test x$glibcpp_cv_S_IFREG = xyes; then
AC_DEFINE(HAVE_S_IFREG)
fi
])
dnl
dnl Check whether poll is available in <poll.h>.
dnl
AC_DEFUN(GLIBCPP_CHECK_POLL, [
AC_CACHE_VAL(glibcpp_cv_POLL, [
AC_TRY_COMPILE([#include <poll.h>],
[struct pollfd pfd[1]; pfd[0].events = POLLIN; poll(pfd, 1, 0); ],
[glibcpp_cv_POLL=yes],
[glibcpp_cv_POLL=no])
])
if test x$glibcpp_cv_POLL = xyes; then
AC_DEFINE(HAVE_POLL)
fi
])
# Check whether LC_MESSAGES is available in <locale.h>.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
@ -2203,12 +2284,14 @@ if test x$enable_shared = xno ||
fi
# Check to see if libgcc_s exists, indicating that shared libgcc is possible.
AC_MSG_CHECKING([for shared libgcc])
ac_save_CFLAGS="$CFLAGS"
CFLAGS=' -lgcc_s'
AC_TRY_LINK( , [return 0], glibcpp_shared_libgcc=yes, glibcpp_shared_libgcc=no)
CFLAGS="$ac_save_CFLAGS"
AC_MSG_RESULT($glibcpp_shared_libgcc)
if test $enable_symvers != no; then
AC_MSG_CHECKING([for shared libgcc])
ac_save_CFLAGS="$CFLAGS"
CFLAGS=' -lgcc_s'
AC_TRY_LINK(, [return 0], glibcpp_shared_libgcc=yes, glibcpp_shared_libgcc=no)
CFLAGS="$ac_save_CFLAGS"
AC_MSG_RESULT($glibcpp_shared_libgcc)
fi
# For GNU ld, we need at least this version. It's 2.12 in the same format
# as the tested-for version. See GLIBCPP_CHECK_LINKER_FEATURES for more.
@ -2248,15 +2331,15 @@ fi
dnl Everything parsed; figure out what file to use.
case $enable_symvers in
no)
LINKER_MAP=config/linker-map.dummy
SYMVER_MAP=config/linker-map.dummy
;;
gnu)
LINKER_MAP=config/linker-map.gnu
SYMVER_MAP=config/linker-map.gnu
AC_DEFINE(_GLIBCPP_SYMVER)
;;
esac
AC_LINK_FILES($LINKER_MAP, src/linker.map)
AC_SUBST(SYMVER_MAP)
AM_CONDITIONAL(GLIBCPP_BUILD_VERSIONED_SHLIB, test $enable_symvers != no)
AC_MSG_CHECKING([versioning on shared library symbols])
AC_MSG_RESULT($enable_symvers)

View File

@ -11,7 +11,7 @@ dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE.
dnl
dnl Initialize configure bits.
dnl Initialize basic configure bits, set toplevel_srcdir for Makefiles.
dnl
dnl GLIBCPP_TOPREL_CONFIGURE
AC_DEFUN(GLIBCPP_TOPREL_CONFIGURE, [
@ -49,13 +49,10 @@ AC_DEFUN(GLIBCPP_TOPREL_CONFIGURE, [
])
dnl
dnl Initialize configure bits.
dnl Initialize the rest of the library configury.
dnl
dnl GLIBCPP_CONFIGURE
AC_DEFUN(GLIBCPP_CONFIGURE, [
#possibly test for the presence of the compiler sources here?
# Export build and source directories.
# These need to be absolute paths, yet at the same time need to
# canonicalize only relative paths, because then amd will not unmount
@ -282,8 +279,7 @@ AC_DEFUN(GLIBCPP_CHECK_COMPILER_FEATURES, [
# this is the suspicious part
CXXFLAGS=''
fi
if test x"$ac_fdsections" = x"yes" &&
test x"$enable_debug" = x"no"; then
if test x"$ac_fdsections" = x"yes"; then
SECTION_FLAGS='-ffunction-sections -fdata-sections'
fi
AC_MSG_RESULT($ac_fdsections)
@ -376,7 +372,7 @@ AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
fi
# Set linker optimization flags.
if test x"$with_gnu_ld" = x"yes" && test x"$enable_debug" = x"no"; then
if test x"$with_gnu_ld" = x"yes"; then
OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
fi
@ -744,7 +740,6 @@ AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT, [
fi
])
dnl
dnl Check to see what the underlying c library is like
dnl These checks need to do two things:
@ -760,7 +755,7 @@ dnl GLIBCPP_CHECK_STDLIB_SUPPORT
AC_DEFUN(GLIBCPP_CHECK_STDLIB_SUPPORT, [
ac_test_CXXFLAGS="${CXXFLAGS+set}"
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtold)
GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtof)
@ -802,7 +797,7 @@ dnl GLIBCPP_CHECK_MATH_SUPPORT
AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
ac_test_CXXFLAGS="${CXXFLAGS+set}"
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
dnl Check libm
AC_CHECK_LIB(m, sin, libm="-lm")
@ -927,7 +922,11 @@ AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
AC_CHECK_FUNCS([__signbitl], , [LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"])
fi
if test -n "$LIBMATHOBJS"; then
need_libmath=yes
fi
AC_SUBST(LIBMATHOBJS)
AM_CONDITIONAL(GLIBCPP_BUILD_LIBMATH, test "$need_libmath" = yes)
])
@ -937,9 +936,9 @@ dnl compilation, pick them up here.
dnl
dnl GLIBCPP_CHECK_TARGET
AC_DEFUN(GLIBCPP_CHECK_TARGET, [
. [$]{glibcpp_basedir}/configure.target
AC_MSG_RESULT(CPU config directory is $cpu_include_dir)
AC_MSG_RESULT(OS config directory is $os_include_dir)
. [$]{glibcpp_basedir}/configure.target
AC_MSG_RESULT(CPU config directory is $cpu_include_dir)
AC_MSG_RESULT(OS config directory is $os_include_dir)
])
@ -953,6 +952,8 @@ dnl Define HAVE_MBSTATE_T if mbstate_t is not in wchar.h
dnl
dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT
AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
dnl Wide characters disabled by default.
enable_wchar_t=no
dnl Test wchar.h for mbstate_t, which is needed for char_traits and
dnl others even if wchar_t support is not on.
@ -998,7 +999,7 @@ AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
ac_wfuncs=no)
dnl Checks for names injected into std:: by the c_std headers.
AC_CHECK_FUNCS(btowc wctob fgetwc fgetwc fgetws fputwc fputws fwide \
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 \
@ -1043,30 +1044,33 @@ AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
dnl At the moment, only enable wchar_t specializations if all the
dnl above support is present.
AC_MSG_CHECKING([for enabled wchar_t specializations])
if test x"$ac_isoC99_wchar_t" = xyes &&
test x"$ac_XPG2_wchar_t" = xyes; then
AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
AC_MSG_RESULT("yes")
else
AC_MSG_RESULT("no")
AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
enable_wchar_t=yes
fi
else
dnl Wide characters disabled by the user.
AC_MSG_WARN([wchar_t support disabled.])
fi
AC_MSG_CHECKING([for enabled wchar_t specializations])
AC_MSG_RESULT($enable_wchar_t)
AM_CONDITIONAL(GLIBCPP_TEST_WCHAR_T, test "$enable_wchar_t" = yes)
])
dnl
dnl Check for special debugging mode; not for production use.
dnl Check to see if debugging libraries are to be built.
dnl
dnl GLIBCPP_ENABLE_DEBUG
dnl --enable-debug sets '-ggdb3 -O0'.
dnl --disable-debug sets '-g' and whatever optimization options the
dnl compiler can handle.
dnl + --enable-maintainer-mode automatically defaults this to on.
dnl + Perhaps -D/-U of NDEBUG, DEBUG, DEBUG_ASSERT, ...?
dnl
dnl --enable-debug
dnl builds a separate set of debugging libraries in addition to the
dnl normal (shared, static) libstdc++ binaries.
dnl
dnl --disable-debug
dnl builds only one (non-debug) version of libstdc++.
dnl
dnl --enable-debug-flags=FLAGS
dnl iff --enable-debug == yes, then use FLAGS to build the debug library.
dnl
dnl + Usage: GLIBCPP_ENABLE_DEBUG[(DEFAULT)]
dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
dnl defaults to `no'.
@ -1074,7 +1078,7 @@ AC_DEFUN(GLIBCPP_ENABLE_DEBUG, [dnl
define([GLIBCPP_ENABLE_DEBUG_DEFAULT], ifelse($1, yes, yes, no))dnl
AC_ARG_ENABLE(debug,
changequote(<<, >>)dnl
<< --enable-debug extra debugging, turn off optimization [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT],
<< --enable-debug build extra debug library [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT],
changequote([, ])dnl
[case "${enableval}" in
yes) enable_debug=yes ;;
@ -1082,17 +1086,56 @@ changequote([, ])dnl
*) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;;
esac],
enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl
AC_MSG_CHECKING([for additional debug build])
AC_MSG_RESULT($enable_debug)
AM_CONDITIONAL(GLIBCPP_BUILD_DEBUG, test "$enable_debug" = yes)
])
dnl Check for explicit debug flags.
dnl
dnl GLIBCPP_ENABLE_DEBUG_FLAGS
dnl
dnl --enable-debug-flags='-O1'
dnl is a general method for passing flags to be used when
dnl building debug libraries with --enable-debug.
dnl
dnl --disable-debug-flags does nothing.
dnl + Usage: GLIBCPP_ENABLE_DEBUG_FLAGS(default flags)
dnl If "default flags" is an empty string (or "none"), the effect is
dnl the same as --disable or --enable=no.
AC_DEFUN(GLIBCPP_ENABLE_DEBUG_FLAGS, [dnl
define([GLIBCPP_ENABLE_DEBUG_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
AC_ARG_ENABLE(debug_flags,
changequote(<<, >>)dnl
<< --enable-debug-flags=FLAGS pass compiler FLAGS when building debug
library;[default=>>GLIBCPP_ENABLE_DEBUG_FLAGS_DEFAULT],
changequote([, ])dnl
[case "${enableval}" in
none) ;;
-*) enable_debug_flags="${enableval}" ;;
*) AC_MSG_ERROR([Unknown argument to extra debugging flags]) ;;
esac],
enable_debug_flags=GLIBCPP_ENABLE_DEBUG_FLAGS_DEFAULT)dnl
dnl Option parsed, now set things appropriately
case "${enable_debug}" in
yes)
DEBUG_FLAGS='-O0 -ggdb3'
;;
no)
DEBUG_FLAGS='-g'
case x"$enable_debug" in
xyes)
case "$enable_debug_flags" in
none)
DEBUG_FLAGS="-g3 -O0";;
-*) #valid input
DEBUG_FLAGS="${enableval}"
esac
;;
xno)
DEBUG_FLAGS=""
;;
esac
AC_SUBST(DEBUG_FLAGS)
AC_MSG_CHECKING([for debug build flags])
AC_MSG_RESULT($DEBUG_FLAGS)
])
@ -1113,39 +1156,36 @@ dnl If "default flags" is an empty string (or "none"), the effect is
dnl the same as --disable or --enable=no.
AC_DEFUN(GLIBCPP_ENABLE_CXX_FLAGS, [dnl
define([GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
AC_ARG_ENABLE(cxx-flags,
AC_MSG_CHECKING([for extra compiler flags for building])
AC_ARG_ENABLE(cxx_flags,
changequote(<<, >>)dnl
<< --enable-cxx-flags=FLAGS pass compiler FLAGS when building library;
[default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT],
[default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT],
changequote([, ])dnl
[case "x$enableval" in
xyes)
AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
xno|x)
enable_cxx_flags='' ;;
*)
enable_cxx_flags="$enableval" ;;
esac],
enable_cxx_flags='GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT')
dnl Thinko on my part during design. This kludge is the workaround.
if test "$enable_cxx_flags" = "none"; then
enable_cxx_flags='';
fi
[case "x$enable_cxx_flags" in
xyes)
AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
xno | xnone | x)
enable_cxx_flags='' ;;
*)
enable_cxx_flags="$enableval" ;;
esac],
enable_cxx_flags=GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT)
dnl Run through flags (either default or command-line) and set anything
dnl extra (e.g., #defines) that must accompany particular g++ options.
if test -n "$enable_cxx_flags"; then
for f in $enable_cxx_flags; do
case "$f" in
-fhonor-std) ;;
-*) ;;
*) # and we're trying to pass /what/ exactly?
AC_MSG_ERROR([compiler flags start with a -]) ;;
esac
done
for f in $enable_cxx_flags; do
case "$f" in
-fhonor-std) ;;
-*) ;;
*) # and we're trying to pass /what/ exactly?
AC_MSG_ERROR([compiler flags start with a -]) ;;
esac
done
fi
EXTRA_CXX_FLAGS="$enable_cxx_flags"
AC_MSG_RESULT($EXTRA_CXX_FLAGS)
AC_SUBST(EXTRA_CXX_FLAGS)
])
@ -1310,24 +1350,20 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
glibcpp_localedir=${glibcpp_builddir}/po/share/locale
AC_SUBST(glibcpp_localedir)
# For the time being, transform ctype_noninline.h to ctype_members_char.cc
# CCTYPE_CHAR_CC=config/${os_include_dir}/ctype_noninline.h
AC_SUBST(USE_NLS)
AC_SUBST(CLOCALE_H)
AC_SUBST(CCODECVT_H)
AC_SUBST(CMESSAGES_H)
AC_SUBST(CCODECVT_CC)
AC_SUBST(CCOLLATE_CC)
AC_SUBST(CCTYPE_CC)
AC_SUBST(CMESSAGES_CC)
AC_SUBST(CMONEY_CC)
AC_SUBST(CNUMERIC_CC)
AC_SUBST(CTIME_H)
AC_LINK_FILES($CLOCALE_CC, src/c++locale.cc)
AC_LINK_FILES($CCODECVT_CC, src/codecvt_members.cc)
AC_LINK_FILES($CCOLLATE_CC, src/collate_members.cc)
# AC_LINK_FILES($CCTYPE_CHAR_CC, src/ctype_members_char.cc)
AC_LINK_FILES($CCTYPE_CC, src/ctype_members.cc)
AC_LINK_FILES($CMESSAGES_CC, src/messages_members.cc)
AC_LINK_FILES($CMONEY_CC, src/monetary_members.cc)
AC_LINK_FILES($CNUMERIC_CC, src/numeric_members.cc)
AC_LINK_FILES($CTIME_CC, src/time_members.cc)
AC_LINK_FILES($CLOCALE_INTERNAL_H, src/c++locale_internal.h)
AC_SUBST(CTIME_CC)
AC_SUBST(CLOCALE_CC)
AC_SUBST(CLOCALE_INTERNAL_H)
])
@ -1428,7 +1464,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
esac
AC_SUBST(CSTDIO_H)
AC_SUBST(BASIC_FILE_H)
AC_LINK_FILES($BASIC_FILE_CC, src/basic_file.cc)
AC_SUBST(BASIC_FILE_CC)
# 2000-08-04 bkoz hack
CCODECVT_C=config/io/c_io_libio_codecvt.c
@ -1511,7 +1547,7 @@ void foo()
}
EOF
old_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="-S -fexceptions"
CXXFLAGS=-S
if AC_TRY_EVAL(ac_compile); then
if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
enable_sjlj_exceptions=yes
@ -1747,21 +1783,20 @@ AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
dnl
dnl Check for what kind of C headers to use.
dnl Check for what type of C headers to use.
dnl
dnl GLIBCPP_ENABLE_CHEADERS
dnl --enable-cheaders= [does stuff].
dnl --disable-cheaders [does not do anything, really].
dnl + This will eventually need to be 'c_shadow' by default.
dnl + Usage: GLIBCPP_ENABLE_CHEADERS[(DEFAULT)]
dnl Where DEFAULT is either `c' or `c_std' or 'c_shadow'.
dnl Where DEFAULT is either `c' or `c_std'.
dnl If ommitted, it defaults to `c_std'.
AC_DEFUN(GLIBCPP_ENABLE_CHEADERS, [dnl
define([GLIBCPP_ENABLE_CHEADERS_DEFAULT], ifelse($1, c_std, c_std, c_std))dnl
AC_MSG_CHECKING([for c header strategy to use])
AC_ARG_ENABLE(cheaders,
changequote(<<, >>)dnl
<< --enable-cheaders construct "C" header files for g++ [default=>>GLIBCPP_ENABLE_CHEADERS_DEFAULT],
<< --enable-cheaders=MODEL construct "C" header files for g++ [default=>>GLIBCPP_ENABLE_CHEADERS_DEFAULT],
changequote([, ])
[case "$enableval" in
c)
@ -1770,9 +1805,6 @@ changequote([, ])
c_std)
enable_cheaders=c_std
;;
c_shadow)
enable_cheaders=c_shadow
;;
*) AC_MSG_ERROR([Unknown argument to enable/disable "C" headers])
;;
esac],
@ -1781,9 +1813,6 @@ changequote([, ])
dnl Option parsed, now set things appropriately
case "$enable_cheaders" in
c_shadow)
C_INCLUDE_DIR='${glibcpp_srcdir}/include/c_shadow'
;;
c_std)
C_INCLUDE_DIR='${glibcpp_srcdir}/include/c_std'
;;
@ -1832,7 +1861,6 @@ dnl TOPLEVEL_INCLUDES
dnl LIBMATH_INCLUDES
dnl LIBSUPCXX_INCLUDES
dnl LIBIO_INCLUDES
dnl CSHADOW_INCLUDES
dnl
dnl GLIBCPP_EXPORT_INCLUDES
AC_DEFUN(GLIBCPP_EXPORT_INCLUDES, [
@ -1871,7 +1899,7 @@ AC_DEFUN(GLIBCPP_EXPORT_FLAGS, [
OPTIMIZE_CXXFLAGS=
AC_SUBST(OPTIMIZE_CXXFLAGS)
WARN_FLAGS='-Wall -Wno-format -W -Wwrite-strings -Winline'
WARN_FLAGS='-Wall -Wno-format -W -Wwrite-strings'
AC_SUBST(WARN_FLAGS)
])
@ -2053,8 +2081,9 @@ dnl string, '#' otherwise
dnl Check for headers for, and arguments to, the setrlimit() function.
dnl Used only in testsuite_hooks.h.
AC_DEFUN(GLIBCPP_CHECK_SETRLIMIT_ancilliary, [
AC_TRY_COMPILE([#include <sys/resource.h>
#include <unistd.h>
AC_TRY_COMPILE([#include <unistd.h>
#include <sys/time.h>
#include <sys/resource.h>
], [ int f = RLIMIT_$1 ; ],
[glibcpp_mresult=1], [glibcpp_mresult=0])
AC_DEFINE_UNQUOTED(HAVE_MEMLIMIT_$1, $glibcpp_mresult,
@ -2062,7 +2091,7 @@ AC_DEFUN(GLIBCPP_CHECK_SETRLIMIT_ancilliary, [
])
AC_DEFUN(GLIBCPP_CHECK_SETRLIMIT, [
setrlimit_have_headers=yes
AC_CHECK_HEADERS(sys/resource.h unistd.h,
AC_CHECK_HEADERS(unistd.h sys/time.h sys/resource.h,
[],
setrlimit_have_headers=no)
# If don't have the headers, then we can't run the tests now, and we
@ -2076,8 +2105,9 @@ AC_DEFUN(GLIBCPP_CHECK_SETRLIMIT, [
# Check for rlimit, setrlimit.
AC_CACHE_VAL(ac_setrlimit, [
AC_TRY_COMPILE([#include <sys/resource.h>
#include <unistd.h>
AC_TRY_COMPILE([#include <unistd.h>
#include <sys/time.h>
#include <sys/resource.h>
],
[ struct rlimit r; setrlimit(0, &r);],
[ac_setrlimit=yes], [ac_setrlimit=no])
@ -2101,18 +2131,30 @@ dnl the testsuite_hooks.h header.
dnl
dnl GLIBCPP_CONFIGURE_TESTSUITE [no args]
AC_DEFUN(GLIBCPP_CONFIGURE_TESTSUITE, [
GLIBCPP_CHECK_SETRLIMIT
if test x"$GLIBCPP_IS_CROSS_COMPILING" = xfalse; then
# Do checks for memory limit functions.
GLIBCPP_CHECK_SETRLIMIT
# Look for setenv, so that extended locale tests can be performed.
GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
# Look for setenv, so that extended locale tests can be performed.
GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
fi
# Export file names for ABI checking.
baseline_file="${glibcpp_srcdir}/config/abi/${abi_baseline_triplet}/baseline_symbols.txt"
AC_SUBST(baseline_file)
baseline_dir="${glibcpp_srcdir}/config/abi/${abi_baseline_pair}\$(MULTISUBDIR)"
AC_SUBST(baseline_dir)
# Don't do ABI checking unless native.
AM_CONDITIONAL(GLIBCPP_BUILD_ABI_CHECK,
test x"$build" = x"$host" && test -z "$with_cross_host")
# Determine if checking the ABI is desirable.
if test x$enable_symvers = xno; then
enable_abi_check=no
else
case "$host" in
*-*-cygwin*)
enable_abi_check=no ;;
*)
enable_abi_check=yes ;;
esac
fi
AM_CONDITIONAL(GLIBCPP_TEST_ABI, test "$enable_abi_check" = yes)
])
@ -2126,6 +2168,45 @@ AC_DEFUN([AC_LIBTOOL_DLOPEN])
AC_DEFUN([AC_PROG_LD])
])
dnl
dnl Check whether S_ISREG (Posix) or S_IFREG is available in <sys/stat.h>.
dnl
AC_DEFUN(GLIBCPP_CHECK_S_ISREG_OR_S_IFREG, [
AC_CACHE_VAL(glibcpp_cv_S_ISREG, [
AC_TRY_LINK([#include <sys/stat.h>],
[struct stat buffer; fstat(0, &buffer); S_ISREG(buffer.st_mode); ],
[glibcpp_cv_S_ISREG=yes],
[glibcpp_cv_S_ISREG=no])
])
AC_CACHE_VAL(glibcpp_cv_S_IFREG, [
AC_TRY_LINK([#include <sys/stat.h>],
[struct stat buffer; fstat(0, &buffer); S_IFREG & buffer.st_mode; ],
[glibcpp_cv_S_IFREG=yes],
[glibcpp_cv_S_IFREG=no])
])
if test x$glibcpp_cv_S_ISREG = xyes; then
AC_DEFINE(HAVE_S_ISREG)
elif test x$glibcpp_cv_S_IFREG = xyes; then
AC_DEFINE(HAVE_S_IFREG)
fi
])
dnl
dnl Check whether poll is available in <poll.h>.
dnl
AC_DEFUN(GLIBCPP_CHECK_POLL, [
AC_CACHE_VAL(glibcpp_cv_POLL, [
AC_TRY_COMPILE([#include <poll.h>],
[struct pollfd pfd[1]; pfd[0].events = POLLIN; poll(pfd, 1, 0); ],
[glibcpp_cv_POLL=yes],
[glibcpp_cv_POLL=no])
])
if test x$glibcpp_cv_POLL = xyes; then
AC_DEFINE(HAVE_POLL)
fi
])
# Check whether LC_MESSAGES is available in <locale.h>.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
@ -2215,12 +2296,14 @@ if test x$enable_shared = xno ||
fi
# Check to see if libgcc_s exists, indicating that shared libgcc is possible.
AC_MSG_CHECKING([for shared libgcc])
ac_save_CFLAGS="$CFLAGS"
CFLAGS=' -lgcc_s'
AC_TRY_LINK( , [return 0], glibcpp_shared_libgcc=yes, glibcpp_shared_libgcc=no)
CFLAGS="$ac_save_CFLAGS"
AC_MSG_RESULT($glibcpp_shared_libgcc)
if test $enable_symvers != no; then
AC_MSG_CHECKING([for shared libgcc])
ac_save_CFLAGS="$CFLAGS"
CFLAGS=' -lgcc_s'
AC_TRY_LINK(, [return 0], glibcpp_shared_libgcc=yes, glibcpp_shared_libgcc=no)
CFLAGS="$ac_save_CFLAGS"
AC_MSG_RESULT($glibcpp_shared_libgcc)
fi
# For GNU ld, we need at least this version. It's 2.12 in the same format
# as the tested-for version. See GLIBCPP_CHECK_LINKER_FEATURES for more.
@ -2260,15 +2343,15 @@ fi
dnl Everything parsed; figure out what file to use.
case $enable_symvers in
no)
LINKER_MAP=config/linker-map.dummy
SYMVER_MAP=config/linker-map.dummy
;;
gnu)
LINKER_MAP=config/linker-map.gnu
SYMVER_MAP=config/linker-map.gnu
AC_DEFINE(_GLIBCPP_SYMVER)
;;
esac
AC_LINK_FILES($LINKER_MAP, src/linker.map)
AC_SUBST(SYMVER_MAP)
AM_CONDITIONAL(GLIBCPP_BUILD_VERSIONED_SHLIB, test $enable_symvers != no)
AC_MSG_CHECKING([versioning on shared library symbols])
AC_MSG_RESULT($enable_symvers)

View File

@ -38,6 +38,18 @@
// Define if gthr-default.h exists (meaning that threading support is enabled).
#undef HAVE_GTHR_DEFAULT
// Define if drand48 exists.
#undef HAVE_DRAND48
// Define if getpagesize exists.
#undef HAVE_GETPAGESIZE
// Define if setenv exists.
#undef HAVE_SETENV
// Define if sigsetjmp exists.
#undef HAVE_SIGSETJMP
// Define if mbstate_t exists in wchar.h.
#undef HAVE_MBSTATE_T
@ -101,6 +113,15 @@
// Define if the compiler/host combination has __builtin_sqrtl
#undef HAVE___BUILTIN_SQRTL
// Define if poll is available in <poll.h>.
#undef HAVE_POLL
// Define if S_ISREG (Posix) is available in <sys/stat.h>.
#undef HAVE_S_ISREG
// Define if S_IFREG is available in <sys/stat.h>.
#undef HAVE_S_IFREG
// Define if LC_MESSAGES is available in <locale.h>.
#undef HAVE_LC_MESSAGES
@ -731,6 +752,12 @@
/* Define if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define if you have the <sys/filio.h> header file. */
#undef HAVE_SYS_FILIO_H
/* Define if you have the <sys/ioctl.h> header file. */
#undef HAVE_SYS_IOCTL_H
/* Define if you have the <sys/isa_defs.h> header file. */
#undef HAVE_SYS_ISA_DEFS_H
@ -743,6 +770,9 @@
/* Define if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,76 @@
// Low-level functions for atomic operations: Alpha version -*- C++ -*-
// Copyright (C) 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
/* @@@ With gas we can play nice .subsection games to get the
non-predicted branch pointing forward. But Digital assemblers
don't understand those directives. This isn't a terribly
important issue, so just ignore it. */
typedef int _Atomic_word;
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word* __mem, int __val)
{
register int __result, __tmp;
__asm__ __volatile__ (
"\n$Lxadd_%=:\n\t"
"ldl_l %0,%3\n\t"
"addl %0,%4,%1\n\t"
"stl_c %1,%2\n\t"
"beq %1,$Lxadd_%=\n\t"
"mb"
: "=&r"(__result), "=&r"(__tmp), "=m"(*__mem)
: "m" (*__mem), "r"(__val));
return __result;
}
static inline void
__attribute__ ((__unused__))
__atomic_add (volatile _Atomic_word* __mem, int __val)
{
register _Atomic_word __result;
__asm__ __volatile__ (
"\n$Ladd_%=:\n\t"
"ldl_l %0,%2\n\t"
"addl %0,%3,%0\n\t"
"stl_c %0,%1\n\t"
"beq %0,$Ladd_%=\n\t"
"mb"
: "=&r"(__result), "=m"(*__mem)
: "m" (*__mem), "r"(__val));
}
#endif /* atomicity.h */

View File

@ -0,0 +1,79 @@
// Low-level functions for atomic operations: CRIS 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
// This entity must not cross a page boundary.
typedef int _Atomic_word __attribute__ ((__aligned__ (4)));
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (_Atomic_word* __mem, int __val)
{
int __tmp;
_Atomic_word __result;
#if (__CRIS_arch_version >= 10)
__asm__ __volatile__ (" clearf \n"
"0: \n"
" move.d %4,%2 \n"
" move.d [%3],%0 \n"
" add.d %0,%2 \n"
" ax \n"
" move.d %2,[%3] \n"
" bwf 0b \n"
" clearf \n"
: "=&r" (__result), "=m" (*__mem), "=&r" (__tmp)
: "r" (__mem), "g" (__val), "m" (*__mem)
: "memory");
#else
__asm__ __volatile__ (" move $ccr,$r9 \n"
" di \n"
" move.d %4,%2 \n"
" move.d [%3],%0 \n"
" add.d %0,%2 \n"
" move.d %2,[%3] \n"
" move $r9,$ccr \n"
: "=&r" (__result), "=m" (*__mem), "=&r" (__tmp)
: "r" (__mem), "g" (__val), "m" (*__mem)
: "memory", "r9");
#endif
return __result;
}
static inline void
__attribute__ ((__unused__))
__atomic_add (_Atomic_word* __mem, int __val)
{
__exchange_and_add (__mem, __val);
}
#endif /* atomicity.h */

View File

@ -0,0 +1,77 @@
// Low-level functions for atomic operations: Generic version -*- C++ -*-
// Copyright (C) 1999, 2001, 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
// 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 <bits/gthr.h>
#define _GLIBCPP_NEED_GENERIC_MUTEX
typedef int _Atomic_word;
namespace __gnu_cxx
{
extern __gthread_mutex_t _Atomic_add_mutex;
#ifndef __GTHREAD_MUTEX_INIT
extern __gthread_once_t _Atomic_add_mutex_once;
extern void __gthread_atomic_add_mutex_once();
#endif
}
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word* __mem, int __val)
{
#ifndef __GTHREAD_MUTEX_INIT
__gthread_once (&__gnu_cxx::_Atomic_add_mutex_once,
__gnu_cxx::__gthread_atomic_add_mutex_once);
#endif
_Atomic_word __result;
__gthread_mutex_lock (&__gnu_cxx::_Atomic_add_mutex);
__result = *__mem;
*__mem += __val;
__gthread_mutex_unlock (&__gnu_cxx::_Atomic_add_mutex);
return __result;
}
static inline void
__attribute__ ((__unused__))
__atomic_add (volatile _Atomic_word* __mem, int __val)
{
(void) __exchange_and_add (__mem, __val);
}
#endif /* atomicity.h */

View File

@ -0,0 +1,90 @@
/* Low-level functions for atomic operations. PA-RISC version. -*- C++ -*-
Copyright 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
typedef int _Atomic_word;
template <int __inst>
struct __Atomicity_lock
{
static volatile int _S_atomicity_lock;
};
template <int __inst>
volatile int
__Atomicity_lock<__inst>::_S_atomicity_lock __attribute__ ((aligned (16))) = 1;
/* Because of the lack of weak support when using the hpux
som linker, we explicitly instantiate the atomicity lock
in src/misc-inst.cc when _GLIBCPP_INST_ATOMICITY_LOCK
is defined. */
#ifndef _GLIBCPP_INST_ATOMICITY_LOCK
template volatile int __Atomicity_lock<0>::_S_atomicity_lock;
#endif
static inline int
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word* __mem, int __val)
{
_Atomic_word result;
int tmp;
volatile int& lock = __Atomicity_lock<0>::_S_atomicity_lock;
__asm__ __volatile__ ("ldcw 0(%1),%0\n\t"
"cmpib,<>,n 0,%0,.+20\n\t"
"ldw 0(%1),%0\n\t"
"cmpib,= 0,%0,.-4\n\t"
"nop\n\t"
"b,n .-20"
: "=&r" (tmp)
: "r" (&lock));
result = *__mem;
*__mem = result + __val;
/* Reset lock with PA 2.0 "ordered" store. */
__asm__ __volatile__ ("stw,ma %1,0(%0)"
: : "r" (&lock), "r" (tmp) : "memory");
return result;
}
static inline void
__attribute__ ((__unused__))
__atomic_add (_Atomic_word* __mem, int __val)
{
int tmp;
volatile int& lock = __Atomicity_lock<0>::_S_atomicity_lock;
__asm__ __volatile__ ("ldcw 0(%1),%0\n\t"
"cmpib,<>,n 0,%0,.+20\n\t"
"ldw 0(%1),%0\n\t"
"cmpib,= 0,%0,.-4\n\t"
"nop\n\t"
"b,n .-20"
: "=&r" (tmp)
: "r" (&lock));
*__mem += __val;
/* Reset lock with PA 2.0 "ordered" store. */
__asm__ __volatile__ ("stw,ma %1,0(%0)"
: : "r" (&lock), "r" (tmp) : "memory");
}
#endif

View File

@ -0,0 +1,75 @@
// Low-level functions for atomic operations: x86, x >= 3 version -*- C++ -*-
// Copyright (C) 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
// 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
typedef int _Atomic_word;
template <int __inst>
struct __Atomicity_lock
{
static volatile _Atomic_word _S_atomicity_lock;
};
template <int __inst>
volatile _Atomic_word __Atomicity_lock<__inst>::_S_atomicity_lock = 0;
template volatile _Atomic_word __Atomicity_lock<0>::_S_atomicity_lock;
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
{
register _Atomic_word __result, __tmp = 1;
/* obtain the atomic exchange/add spin lock */
do {
__asm__ __volatile__ ("xchg{l} {%0,%1|%1,%0}"
: "+m" (__Atomicity_lock<0>::_S_atomicity_lock),
"+r" (__tmp));
} while (__tmp);
__result = *__mem;
*__mem += __val;
/* release spin lock */
__Atomicity_lock<0>::_S_atomicity_lock = 0;
return __result;
}
static inline void
__attribute__ ((__unused__))
__atomic_add (volatile _Atomic_word* __mem, int __val)
{
__exchange_and_add (__mem, __val);
}
#endif /* atomicity.h */

View File

@ -0,0 +1,57 @@
// Low-level functions for atomic operations: x86, x >= 4 version -*- C++ -*-
// Copyright (C) 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
typedef int _Atomic_word;
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
{
register _Atomic_word __result;
__asm__ __volatile__ ("lock; xadd{l} {%0,%1|%1,%0}"
: "=r" (__result), "+m" (*__mem)
: "0" (__val)
: "memory");
return __result;
}
static inline void
__attribute__ ((__unused__))
__atomic_add (volatile _Atomic_word* __mem, int __val)
{
__asm__ __volatile__ ("lock; add{l} {%1,%0|%0,%1}"
: "+m" (*__mem) : "ir" (__val) : "memory");
}
#endif /* atomicity.h */

View File

@ -0,0 +1,51 @@
// Low-level functions for atomic operations: IA64 version -*- 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
#include <ia64intrin.h>
typedef int _Atomic_word;
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
{
return __sync_fetch_and_add (__mem, __val);
}
static inline void
__attribute__ ((__unused__))
__atomic_add (volatile _Atomic_word* __mem, int __val)
{
__sync_fetch_and_add (__mem, __val);
}
#endif /* atomicity.h */

View File

@ -0,0 +1,158 @@
// Low-level functions for atomic operations: m68k version -*- C++ -*-
// Copyright (C) 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
// 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
typedef int _Atomic_word;
#if defined(__mc68020__) || defined(__mc68030__) \
|| defined(__mc68040__) || defined(__mc68060__)
// These variants support compare-and-swap.
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
{
register _Atomic_word __result = *__mem;
register _Atomic_word __temp;
__asm__ __volatile__ ("1: move%.l %0,%1\n\t"
"add%.l %2,%1\n\t"
"cas%.l %0,%1,%3\n\t"
"jne 1b"
: "=d" (__result), "=&d" (__temp)
: "d" (__val), "m" (*__mem), "0" (__result)
: "memory");
return __result;
}
#elif defined(__rtems__)
/*
* TAS/JBNE is unsafe on systems with strict priority-based scheduling.
* Disable interrupts, which we can do only from supervisor mode.
*/
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
{
_Atomic_word __result;
short __level, __tmpsr;
__asm__ __volatile__ ("move%.w %%sr,%0\n\tor%.l %0,%1\n\tmove%.w %1,%%sr"
: "=d"(__level), "=d"(__tmpsr) : "1"(0x700));
__result = *__mem;
*__mem = __result + __val;
__asm__ __volatile__ ("move%.w %0,%%sr" : : "d"(__level));
return __result;
}
#elif !defined(__mcf5200__) && !defined(__mcf5300__)
// 68000, 68010, cpu32 and 5400 support test-and-set.
template <int __inst>
struct __Atomicity_lock
{
static volatile unsigned char _S_atomicity_lock;
};
template <int __inst>
volatile unsigned char __Atomicity_lock<__inst>::_S_atomicity_lock = 0;
template volatile unsigned char __Atomicity_lock<0>::_S_atomicity_lock;
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
{
_Atomic_word __result;
__asm__ __volatile__("1: tas %0\n\tjbne 1b"
: "=m"(__Atomicity_lock<0>::_S_atomicity_lock)
: "m"(__Atomicity_lock<0>::_S_atomicity_lock));
__result = *__mem;
*__mem = __result + __val;
__Atomicity_lock<0>::_S_atomicity_lock = 0;
return __result;
}
#elif defined(__vxWorks__) || defined(__embedded__)
// The best we can hope for is to disable interrupts, which we
// can only do from supervisor mode.
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
{
_Atomic_word __result;
short __level, __tmpsr;
__asm__ __volatile__ ("move%.w %%sr,%0\n\tor%.l %0,%1\n\tmove%.w %1,%%sr"
: "=d"(__level), "=d"(__tmpsr) : "1"(0x700));
__result = *__mem;
*__mem = __result + __val;
__asm__ __volatile__ ("move%.w %0,%%sr" : : "d"(__level));
return __result;
}
#else
// These variants do not support any atomic operations at all.
#warning "__exchange_and_add is not atomic for this target"
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
{
_Atomic_word __result;
__result = *__mem;
*__mem = __result + __val;
return __result;
}
#endif /* CAS / IRQ / TAS */
static inline void
__attribute__ ((__unused__))
__atomic_add (volatile _Atomic_word* __mem, int __val)
{
// Careful: using add.l with a memory destination is not
// architecturally guaranteed to be atomic.
(void) __exchange_and_add (__mem, __val);
}
#endif /* atomicity.h */

View File

@ -0,0 +1,81 @@
// Low-level functions for atomic operations.
// Copyright (C) 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
// 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
typedef int _Atomic_word;
static inline int
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
{
int __result, __tmp;
__asm__ __volatile__
("/* Inline exchange & add */\n\t"
"1:\n\t"
".set push\n\t"
".set mips2\n\t"
"ll %0,%3\n\t"
"addu %1,%4,%0\n\t"
"sc %1,%2\n\t"
".set pop\n\t"
"beqz %1,1b\n\t"
"/* End exchange & add */"
: "=&r"(__result), "=&r"(__tmp), "=m"(*__mem)
: "m" (*__mem), "r"(__val)
: "memory");
return __result;
}
static inline void
__attribute__ ((__unused__))
__atomic_add (volatile _Atomic_word *__mem, int __val)
{
int __result;
__asm__ __volatile__
("/* Inline atomic add */\n\t"
"1:\n\t"
".set push\n\t"
".set mips2\n\t"
"ll %0,%2\n\t"
"addu %0,%3,%0\n\t"
"sc %0,%1\n\t"
".set pop\n\t"
"beqz %0,1b\n\t"
"/* End atomic add */"
: "=&r"(__result), "=m"(*__mem)
: "m" (*__mem), "r"(__val)
: "memory");
}
#endif /* atomicity.h */

View File

@ -0,0 +1,78 @@
// Low-level functions for atomic operations: PowerPC version -*- C++ -*-
// Copyright (C) 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
#ifdef __PPC405__
#define _STWCX "sync \n\tstwcx. "
#else
#define _STWCX "stwcx. "
#endif
typedef int _Atomic_word;
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word* __mem, int __val)
{
_Atomic_word __tmp, __res;
__asm__ __volatile__ (
"/* Inline exchange & add */\n"
"0:\t"
"lwarx %0,0,%2 \n\t"
"add%I3 %1,%0,%3 \n\t"
_STWCX " %1,0,%2 \n\t"
"bne- 0b \n\t"
"/* End exchange & add */"
: "=&b"(__res), "=&r"(__tmp)
: "r" (__mem), "Ir"(__val)
: "cr0", "memory");
return __res;
}
static inline void
__attribute__ ((__unused__))
__atomic_add (volatile _Atomic_word *__mem, int __val)
{
_Atomic_word __tmp;
__asm__ __volatile__ (
"/* Inline atomic add */\n"
"0:\t"
"lwarx %0,0,%1 \n\t"
"add%I2 %0,%0,%2 \n\t"
_STWCX " %0,0,%1 \n\t"
"bne- 0b \n\t"
"/* End atomic add */"
: "=&b"(__tmp)
: "r" (__mem), "Ir"(__val)
: "cr0", "memory");
}
#endif /* atomicity.h */

View File

@ -0,0 +1,60 @@
// Low-level functions for atomic operations: S/390 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
typedef int _Atomic_word;
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
{
register _Atomic_word __old_val, __new_val;
__asm__ __volatile__ (" l %0,0(%2)\n"
"0: lr %1,%0\n"
" ar %1,%3\n"
" cs %0,%1,0(%2)\n"
" jl 0b"
: "=&d" (__old_val), "=&d" (__new_val)
: "a" (__mem), "d" (__val) : "cc", "memory" );
return __old_val;
}
static inline void
__attribute__ ((__unused__))
__atomic_add (volatile _Atomic_word *__mem, int __val)
{
__exchange_and_add (__mem, __val);
}
#endif /* atomicity.h */

View File

@ -0,0 +1,131 @@
// Low-level functions for atomic operations: Sparc version -*- C++ -*-
// Copyright (C) 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
// 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
#ifdef __arch64__
typedef long _Atomic_word;
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
{
_Atomic_word __tmp1, __tmp2;
__asm__ __volatile__("1: ldx [%2], %0\n\t"
" add %0, %3, %1\n\t"
" casx [%2], %0, %1\n\t"
" sub %0, %1, %0\n\t"
" brnz,pn %0, 1b\n\t"
" nop"
: "=&r" (__tmp1), "=&r" (__tmp2)
: "r" (__mem), "r" (__val)
: "memory");
return __tmp2;
}
static inline void
__attribute__ ((__unused__))
__atomic_add (volatile _Atomic_word* __mem, int __val)
{
_Atomic_word __tmp1, __tmp2;
__asm__ __volatile__("1: ldx [%2], %0\n\t"
" add %0, %3, %1\n\t"
" casx [%2], %0, %1\n\t"
" sub %0, %1, %0\n\t"
" brnz,pn %0, 1b\n\t"
" nop"
: "=&r" (__tmp1), "=&r" (__tmp2)
: "r" (__mem), "r" (__val)
: "memory");
}
#else /* __arch32__ */
typedef int _Atomic_word;
template <int __inst>
struct __Atomicity_lock
{
static unsigned char _S_atomicity_lock;
};
template <int __inst>
unsigned char __Atomicity_lock<__inst>::_S_atomicity_lock = 0;
template unsigned char __Atomicity_lock<0>::_S_atomicity_lock;
static int
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word* __mem, int __val)
{
_Atomic_word __result, __tmp;
__asm__ __volatile__("1: ldstub [%1], %0\n\t"
" cmp %0, 0\n\t"
" bne 1b\n\t"
" nop"
: "=&r" (__tmp)
: "r" (&__Atomicity_lock<0>::_S_atomicity_lock)
: "memory");
__result = *__mem;
*__mem += __val;
__asm__ __volatile__("stb %%g0, [%0]"
: /* no outputs */
: "r" (&__Atomicity_lock<0>::_S_atomicity_lock)
: "memory");
return __result;
}
static void
__attribute__ ((__unused__))
__atomic_add (volatile _Atomic_word* __mem, int __val)
{
_Atomic_word __tmp;
__asm__ __volatile__("1: ldstub [%1], %0\n\t"
" cmp %0, 0\n\t"
" bne 1b\n\t"
" nop"
: "=&r" (__tmp)
: "r" (&__Atomicity_lock<0>::_S_atomicity_lock)
: "memory");
*__mem += __val;
__asm__ __volatile__("stb %%g0, [%0]"
: /* no outputs */
: "r" (&__Atomicity_lock<0>::_S_atomicity_lock)
: "memory");
}
#endif /* __arch32__ */
#endif /* atomicity.h */

View File

@ -32,6 +32,31 @@
//
#include <bits/basic_file.h>
#include <fcntl.h>
#include <unistd.h>
#ifdef _GLIBCPP_HAVE_SYS_IOCTL_H
#define BSD_COMP /* Get FIONREAD on Solaris2. */
#include <sys/ioctl.h>
#endif
// Pick up FIONREAD on Solaris 2.5.
#ifdef _GLIBCPP_HAVE_SYS_FILIO_H
#include <sys/filio.h>
#endif
#ifdef _GLIBCPP_HAVE_POLL
#include <poll.h>
#endif
#if defined(_GLIBCPP_HAVE_S_ISREG) || defined(_GLIBCPP_HAVE_S_IFREG)
# include <sys/stat.h>
# ifdef _GLIBCPP_HAVE_S_ISREG
# define _GLIBCPP_ISREG(x) S_ISREG(x)
# else
# define _GLIBCPP_ISREG(x) (((x) & S_IFMT) == S_IFREG)
# endif
#endif
namespace std
{
@ -43,8 +68,8 @@ namespace std
{ this->close(); }
void
__basic_file<char>::_M_open_mode(ios_base::openmode __mode, int&, int&,
char* __c_mode)
__basic_file<char>::_M_open_mode(ios_base::openmode __mode, int& __p_mode,
int&, char* __c_mode)
{
bool __testb = __mode & ios_base::binary;
bool __testi = __mode & ios_base::in;
@ -52,18 +77,39 @@ namespace std
bool __testt = __mode & ios_base::trunc;
bool __testa = __mode & ios_base::app;
// Set __c_mode for use in fopen.
// Set __p_mode for use in open.
if (!__testi && __testo && !__testt && !__testa)
strcpy(__c_mode, "w");
{
strcpy(__c_mode, "w");
__p_mode = (O_WRONLY | O_CREAT);
}
if (!__testi && __testo && !__testt && __testa)
strcpy(__c_mode, "a");
{
strcpy(__c_mode, "a");
__p_mode |= O_WRONLY | O_CREAT | O_APPEND;
}
if (!__testi && __testo && __testt && !__testa)
strcpy(__c_mode, "w");
{
strcpy(__c_mode, "w");
__p_mode |= O_WRONLY | O_CREAT | O_TRUNC;
}
if (__testi && !__testo && !__testt && !__testa)
strcpy(__c_mode, "r");
{
strcpy(__c_mode, "r");
__p_mode |= O_RDONLY;
}
if (__testi && __testo && !__testt && !__testa)
strcpy(__c_mode, "r+");
{
strcpy(__c_mode, "r+");
__p_mode |= O_RDWR | O_CREAT;
}
if (__testi && __testo && __testt && !__testa)
strcpy(__c_mode, "w+");
{
strcpy(__c_mode, "w+");
__p_mode |= O_RDWR | O_CREAT | O_TRUNC;
}
if (__testb)
strcat(__c_mode, "b");
}
@ -148,12 +194,12 @@ namespace std
__basic_file* __retval = static_cast<__basic_file*>(NULL);
if (this->is_open())
{
fflush(_M_cfile);
if ((_M_cfile_created && fclose(_M_cfile) == 0) || !_M_cfile_created)
{
_M_cfile = 0;
__retval = this;
}
if (_M_cfile_created)
fclose(_M_cfile);
else
fflush(_M_cfile);
_M_cfile = 0;
__retval = this;
}
return __retval;
}
@ -170,18 +216,54 @@ namespace std
__basic_file<char>::seekoff(streamoff __off, ios_base::seekdir __way,
ios_base::openmode /*__mode*/)
{
fseek(_M_cfile, __off, __way);
return ftell(_M_cfile);
if (!fseek(_M_cfile, __off, __way))
return ftell(_M_cfile);
else
// Fseek failed.
return -1L;
}
streamoff
__basic_file<char>::seekpos(streamoff __pos, ios_base::openmode /*__mode*/)
{
fseek(_M_cfile, __pos, ios_base::beg);
return ftell(_M_cfile);
if (!fseek(_M_cfile, __pos, ios_base::beg))
return ftell(_M_cfile);
else
// Fseek failed.
return -1L;
}
int
__basic_file<char>::sync()
{ return fflush(_M_cfile); }
streamsize
__basic_file<char>::showmanyc_helper()
{
#ifdef FIONREAD
// Pipes and sockets.
int __num = 0;
int __r = ioctl(this->fd(), FIONREAD, &__num);
if (!__r && __num >= 0)
return __num;
#endif
#ifdef _GLIBCPP_HAVE_POLL
// Cheap test.
struct pollfd __pfd[1];
__pfd[0].fd = this->fd();
__pfd[0].events = POLLIN;
if (poll(__pfd, 1, 0) <= 0)
return 0;
#endif
#if defined(_GLIBCPP_HAVE_S_ISREG) || defined(_GLIBCPP_HAVE_S_IFREG)
// Regular files.
struct stat __buffer;
int __ret = fstat(this->fd(), &__buffer);
if (!__ret && _GLIBCPP_ISREG(__buffer.st_mode))
return __buffer.st_size - ftell(_M_cfile);
#endif
return 0;
}
} // namespace std

View File

@ -108,6 +108,9 @@ namespace std
int
sync();
streamsize
showmanyc_helper();
};
} // namespace std

View File

@ -30,7 +30,12 @@ GLIBCPP_3.2 {
{
std::[A-Za]*;
std::ba[a-r]*;
std::basic_[a-r]*;
std::basic_[a-h]*;
std::basic_ifstream*;
std::basic_istringstream*;
std::basic_istream*;
std::basic_iostream*;
std::basic_[j-r]*;
std::basic_streambuf*;
std::basic_stringbuf*;
std::basic_stringstream*;
@ -64,17 +69,65 @@ GLIBCPP_3.2 {
std::locale::_S_num_categories;
std::locale::_S_normalize_category*;
std::locale::_[T-Za-z]*;
std::[A-Zm-z]*;
std::[A-Zm]*;
std::n[a-t]*;
std::num_put_[cw];
std::numeric*;
std::numpunct*;
std::num_get*;
std::num_get_[cw];
std::n[v-z]*;
std::ostrstream*;
std::overflow_error*;
std::out_of_range*;
std::[A-Zp-z]*;
std::__throw_*;
std::__basic_file*;
std::__num_base*;
std::__timepunct*;
std::__numeric_limits_base*;
std::__timepunct*;
std::_S_bit_count;
std::_S_first_one
};
# Names not in an 'extern' block are mangled names.
_ZSt7getline*;
_ZStrs*;
_ZNSo*;
_ZNKSt9basic_ios*;
_ZNSt9basic_iosI[cw]St11char_traitsI[cw]EE15_M_cache_facetsERKSt6locale;
_ZNSt9basic_iosI[cw]St11char_traitsI[cw]EE[A-Z]*;
_ZNSt9basic_iosI[cw]St11char_traitsI[cw]EE[0-9][A-Za-z]*;
_ZNSt9basic_iosI[cw]St11char_traitsI[cw]EE[0-9][0-9][A-Za-z]*;
_ZNSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEEC*;
_ZNSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEED*;
_ZNSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEEC*;
_ZNSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED*;
_ZNKSt7num_putI[cw]St19ostreambuf_iteratorI[cw]St11char_traitsI[cw]EEE6do_put*;
_ZNKSt7num_putI[cw]St19ostreambuf_iteratorI[cw]St11char_traitsI[cw]EEE3put*;
_ZNSt7num_putI[cw]St19ostreambuf_iteratorI[cw]St11char_traitsI[cw]EEE2idE;
_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_convert_intI[lmxy]EES3_S3_RSt8ios_basecccT_;
_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE14_M_convert_intI[lmxy]EES3_S3_RSt8ios_basewccT_;
_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE16_M_convert_floatI[de]EES3_S3_RSt8ios_baseccT_;
_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE16_M_convert_floatI[de]EES3_S3_RSt8ios_basewcT_;
_ZNKSt7num_putI[cw]St19ostreambuf_iteratorI[cw]St11char_traitsI[cw]EEE12_M_widen_int*;
_ZNKSt7num_putI[cw]St19ostreambuf_iteratorI[cw]St11char_traitsI[cw]EEE14_M_widen_float*;
_ZNKSt7num_putI[cw]St19ostreambuf_iteratorI[cw]St11char_traitsI[cw]EEE9_M_insert*;
_ZSt9use_facetISt7num_putI[cw]St19ostreambuf_iteratorI[cw]St11char_traitsI[cw]EEEERKT_RKSt6locale;
# __num_base
_ZNSt10__num_base13_S_format_intERKSt8ios_basePccc;
_ZNSt10__num_base15_S_format_floatERKSt8ios_basePcc[il];
_ZNSt10__num_base8_S_atomsE;
# std::string minus binary operator plus
_ZNKSs*;
@ -104,6 +157,23 @@ GLIBCPP_3.2 {
_ZStplIwSt11char_traitsIwESaIwEESbIT_T0_T1_EPKS3_RKS6_;
_ZStplIwSt11char_traitsIwESaIwEESbIT_T0_T1_ES3_RKS6_;
# std::__basic_file minus showmanyc_helper
_ZNSt12__basic_fileIcED*;
_ZNSt12__basic_fileIcEC*;
_ZNSt12__basic_fileIcE8sys_open*;
_ZNSt12__basic_fileIcE8sys_getc*;
_ZNSt12__basic_fileIcE10sys_ungetc*;
_ZNSt12__basic_fileIcE7seekpos*;
_ZNSt12__basic_fileIcE7seekoff*;
_ZNSt12__basic_fileIcE6xsputn*;
_ZNSt12__basic_fileIcE6xsgetn*;
_ZNSt12__basic_fileIcE5close*;
_ZNSt12__basic_fileIcE4sync*;
_ZNSt12__basic_fileIcE4open*;
_ZNSt12__basic_fileIcE2fd*;
_ZNSt12__basic_fileIcE12_M_open_modeE*;
_ZNKSt12__basic_fileIcE7is_open*;
# std::locale destructors
_ZNSt6localeD*;
@ -181,12 +251,53 @@ GLIBCPP_3.2 {
_ZdaPvRKSt9nothrow_t;
# vtable
_ZTV*;
_ZTT*;
_ZTVS[a-z];
_ZTVSt[0-9][A-Za-z]*;
_ZTVSt[0-9][0-9][A-Za-z]*;
_ZTTS[a-z];
_ZTTSt[0-9][A-Za-z]*;
_ZTTSt[0-9][0-9][A-Za-z]*;
_ZTVN9__gnu_cxx*;
_ZTVNSt6locale5facetE;
_ZTVSt11__timepunctI[cw]E;
_ZTVNSt8ios_base7failureE;
_ZTVSt23__codecvt_abstract_baseI[cw]c11__mbstate_tE;
_ZTVSt21__ctype_abstract_baseI[cw]E;
# XXX
_ZTVN10__cxxabi*;
# typeinfo
_ZTI*;
_ZTS*;
_ZTI[a-z];
_ZTIP[a-z];
_ZTIPK[a-z];
_ZTIS[a-z];
_ZTISt[0-9][A-Za-z]*;
_ZTISt[0-9][0-9][A-Za-z]*;
_ZTS[a-z];
_ZTSS[a-z];
_ZTSP[a-z];
_ZTSPK[a-z];
_ZTSSt[0-9][A-Za-z]*;
_ZTSSt[0-9][0-9][A-Za-z]*;
_ZTSN9__gnu_cxx*;
_ZTIN9__gnu_cxx*;
_ZTINSt8ios_base7failureE;
_ZTSNSt8ios_base7failureE;
_ZTINSt6locale5facetE;
_ZTSNSt6locale5facetE;
_ZTISt11__timepunctI[cw]E;
_ZTSSt11__timepunctI[cw]E;
_ZTSSt10__num_base;
_ZTISt10__num_base;
_ZTSSt21__ctype_abstract_baseI[cw]E;
_ZTISt21__ctype_abstract_baseI[cw]E;
_ZTISt23__codecvt_abstract_baseI[cw]c11__mbstate_tE;
_ZTSSt23__codecvt_abstract_baseI[cw]c11__mbstate_tE;
# XXX
_ZTIN10__cxxabi*;
_ZTSN10__cxxabi*;
# function-scope static objects requires a guard variable.
_ZGV*;
@ -256,6 +367,34 @@ GLIBCPP_3.2.2 {
} GLIBCPP_3.2.1;
GLIBCPP_3.2.3 {
global:
extern "C++"
{
# Needed only when generic cpu's atomicity.h is in use.
__gnu_cxx::_Atomic_add_mutex;
__gnu_cxx::_Atomic_add_mutex_once;
__gnu_cxx::__gthread_atomic_add_mutex_once;
std::__num_base::_S_atoms_in;
std::__num_base::_S_atoms_out
};
_ZNKSt7num_putI[wc]St19ostreambuf_iteratorI[wc]St11char_traitsI[wc]EEE6_M_pad*;
_ZNKSt7num_putI[cw]St19ostreambuf_iteratorI[cw]St11char_traitsI[cw]EEE14_M_convert_intI[yxml]EES3_S3_RSt8ios_base[cw]T_;
_ZNKSt7num_putI[wc]St19ostreambuf_iteratorI[wc]St11char_traitsI[wc]EEE14_M_group_float*;
_ZNKSt7num_putI[wc]St19ostreambuf_iteratorI[wc]St11char_traitsI[wc]EEE12_M_group_int*;
# __basic_file::showmanyc_helper
_ZNSt12__basic_fileIcE16showmanyc_helperEv;
} GLIBCPP_3.2.2;
# Symbols in the support library (libsupc++) have their own tag.
CXXABI_1.2 {
@ -315,3 +454,12 @@ CXXABI_1.2 {
local:
*;
};
# Symbols added after CXXABI_1.2
CXXABI_1.2.1 {
__cxa_guard_acquire;
__cxa_guard_release;
__cxa_guard_abort;
} CXXABI_1.2;

View File

@ -228,9 +228,9 @@ namespace std
+ _S_extra_categories_size] =
{
"LC_CTYPE",
"LC_NUMERIC",
"LC_NUMERIC",
"LC_TIME",
"LC_COLLATE",
"LC_TIME",
"LC_MONETARY",
"LC_MESSAGES"
};

View File

@ -1,6 +1,6 @@
// Wrapper for underlying C-language localization -*- C++ -*-
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
// Copyright (C) 2001, 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
@ -33,6 +33,11 @@
// Written by Benjamin Kosnik <bkoz@redhat.com>
#ifndef _CPP_BITS_C_LOCALE_H
#define _CPP_BITS_C_LOCALE_H 1
#pragma GCC system_header
#include <clocale>
#define _GLIBCPP_NUM_CATEGORIES 0
@ -41,9 +46,15 @@ namespace std
{
typedef int* __c_locale;
// Convert numeric value of type _Tv to string and return length of
// string. If snprintf is available use it, otherwise fall back to
// the unsafe sprintf which, in general, can be dangerous and should
// be avoided.
template<typename _Tv>
int
__convert_from_v(char* __out, const int __size, const char* __fmt,
__convert_from_v(char* __out,
const int __attribute__ ((__unused__)) __size,
const char* __fmt,
_Tv __v, const __c_locale&, int __prec = -1)
{
char* __old = setlocale(LC_ALL, NULL);
@ -69,3 +80,5 @@ namespace std
return __ret;
}
}
#endif

View File

@ -34,7 +34,6 @@
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
#include "c++locale_internal.h"
namespace std
{

View File

@ -40,7 +40,7 @@
{ _M_c_locale_messages = _S_c_locale; }
template<typename _CharT>
messages<_CharT>::messages(__c_locale __cloc, const char*, size_t __refs)
messages<_CharT>::messages(__c_locale, const char*, size_t __refs)
: locale::facet(__refs)
{ _M_c_locale_messages = _S_c_locale; }

View File

@ -1,6 +1,6 @@
// Wrapper for underlying C-language localization -*- C++ -*-
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
// Copyright (C) 2001, 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
@ -36,7 +36,7 @@
#include <locale>
#include <stdexcept>
#include <langinfo.h>
#include "c++locale_internal.h"
#include <bits/c++locale_internal.h>
namespace std
{
@ -191,9 +191,9 @@ namespace std
+ _S_extra_categories_size] =
{
"LC_CTYPE",
"LC_NUMERIC",
"LC_COLLATE",
"LC_NUMERIC",
"LC_TIME",
"LC_COLLATE",
"LC_MONETARY",
"LC_MESSAGES",
"LC_PAPER",

View File

@ -1,6 +1,6 @@
// Wrapper for underlying C-language localization -*- C++ -*-
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
// Copyright (C) 2001, 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
@ -33,6 +33,11 @@
// Written by Benjamin Kosnik <bkoz@redhat.com>
#ifndef _CPP_BITS_C_LOCALE_H
#define _CPP_BITS_C_LOCALE_H 1
#pragma GCC system_header
#include <clocale>
#include <langinfo.h> // For codecvt
#include <iconv.h> // For codecvt using iconv, iconv_t
@ -53,6 +58,10 @@ namespace std
{
typedef __locale_t __c_locale;
// Convert numeric value of type _Tv to string and return length of
// string. If snprintf is available use it, otherwise fall back to
// the unsafe sprintf which, in general, can be dangerous and should
// be avoided.
template<typename _Tv>
int
__convert_from_v(char* __out, const int __size, const char* __fmt,
@ -92,3 +101,5 @@ namespace std
return __ret;
}
}
#endif

View File

@ -1,6 +1,6 @@
// std::codecvt implementation details, GNU version -*- C++ -*-
// Copyright (C) 2002 Free Software Foundation, Inc.
// 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
@ -34,7 +34,7 @@
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
#include "c++locale_internal.h"
#include <bits/c++locale_internal.h>
namespace std
{

View File

@ -34,7 +34,7 @@
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
#include "c++locale_internal.h"
#include <bits/c++locale_internal.h>
namespace std
{

View File

@ -34,7 +34,7 @@
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
#include "c++locale_internal.h"
#include <bits/c++locale_internal.h>
namespace std
{

View File

@ -34,7 +34,7 @@
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
#include "c++locale_internal.h"
#include <bits/c++locale_internal.h>
namespace std
{

View File

@ -34,7 +34,7 @@
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
#include "c++locale_internal.h"
#include <bits/c++locale_internal.h>
namespace std
{
@ -317,7 +317,11 @@ namespace std
template<>
void
moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
const char*)
#else
const char* __name)
#endif
{
if (!__cloc)
{
@ -413,8 +417,12 @@ namespace std
template<>
void
moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
const char*)
#else
const char* __name)
#endif
{
if (!__cloc)
{

View File

@ -34,7 +34,7 @@
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
#include "c++locale_internal.h"
#include <bits/c++locale_internal.h>
namespace std
{

View File

@ -35,7 +35,7 @@
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
#include "c++locale_internal.h"
#include <bits/c++locale_internal.h>
namespace std
{

View File

@ -46,7 +46,8 @@
template<typename _CharT>
__timepunct<_CharT>::__timepunct(__c_locale __cloc,
const char* __s, size_t __refs)
const char* __s,
size_t __refs)
: locale::facet(__refs)
{
#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))

View File

@ -260,7 +260,7 @@
extern_type* __to, extern_type* __to_end,
extern_type*& __to_next) const
{
result __ret = error;
result __ret = codecvt_base::error;
if (__state._M_good())
{
typedef state_type::__desc_type __desc_type;
@ -304,7 +304,7 @@
{
__from_next = reinterpret_cast<const intern_type*>(__cfrom);
__to_next = reinterpret_cast<extern_type*>(__cto);
__ret = ok;
__ret = codecvt_base::ok;
}
else
{
@ -312,10 +312,10 @@
{
__from_next = reinterpret_cast<const intern_type*>(__cfrom);
__to_next = reinterpret_cast<extern_type*>(__cto);
__ret = partial;
__ret = codecvt_base::partial;
}
else
__ret = error;
__ret = codecvt_base::error;
}
}
return __ret;
@ -327,7 +327,7 @@
do_unshift(state_type& __state, extern_type* __to,
extern_type* __to_end, extern_type*& __to_next) const
{
result __ret = error;
result __ret = codecvt_base::error;
if (__state._M_good())
{
typedef state_type::__desc_type __desc_type;
@ -345,14 +345,14 @@
{
__to_next = reinterpret_cast<extern_type*>(__cto);
if (__tlen == __tmultiple * (__to_end - __to))
__ret = noconv;
__ret = codecvt_base::noconv;
else if (__tlen == 0)
__ret = ok;
__ret = codecvt_base::ok;
else
__ret = partial;
__ret = codecvt_base::partial;
}
else
__ret = error;
__ret = codecvt_base::error;
}
return __ret;
}
@ -365,7 +365,7 @@
intern_type* __to, intern_type* __to_end,
intern_type*& __to_next) const
{
result __ret = error;
result __ret = codecvt_base::error;
if (__state._M_good())
{
typedef state_type::__desc_type __desc_type;
@ -410,7 +410,7 @@
{
__from_next = reinterpret_cast<const extern_type*>(__cfrom);
__to_next = reinterpret_cast<intern_type*>(__cto);
__ret = ok;
__ret = codecvt_base::ok;
}
else
{
@ -418,10 +418,10 @@
{
__from_next = reinterpret_cast<const extern_type*>(__cfrom);
__to_next = reinterpret_cast<intern_type*>(__cto);
__ret = partial;
__ret = codecvt_base::partial;
}
else
__ret = error;
__ret = codecvt_base::error;
}
}
return __ret;

View File

@ -0,0 +1,59 @@
// Low-level functions for atomic operations: AIX version -*- 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
/* We cannot use the cpu/powerpc/bits/atomicity.h inline assembly
definitions for these operations since they depend on operations
that are not available on the original POWER architecture. AIX
still runs on the POWER architecture, so it would be incorrect to
assume the existence of these instructions. */
/* This should match the type pointed to by atomic_p in
<sys/atomic_op.h>. */
typedef int _Atomic_word;
#include <sys/atomic_op.h>
static inline int
__attribute__ ((__unused__))
__exchange_and_add (atomic_p __mem, int __val)
{
return fetch_and_add (__mem, __val);
}
static inline void
__attribute__ ((__unused__))
__atomic_add (atomic_p __mem, int __val)
{
(void) fetch_and_add (__mem, __val);
}
#endif /* atomicity.h */

View File

@ -0,0 +1,55 @@
// Locale support -*- C++ -*-
// Copyright (C) 2000, 1999 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
struct ctype_base
{
// Non-standard typedefs.
typedef const 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 int mask;
static const mask upper = _ISUPPER;
static const mask lower = _ISLOWER;
static const mask alpha = _ISALPHA;
static const mask digit = _ISDIGIT;
static const mask xdigit = _ISXDIGIT;
static const mask space = _ISSPACE;
static const mask print = _ISPRINT;
static const mask graph = _ISGRAPH;
static const mask cntrl = _ISCNTRL;
static const mask punct = _ISPUNCT;
static const mask alnum = _ISALNUM;
};

View File

@ -0,0 +1,76 @@
// 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
// 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 __OBJ_DATA(__lc_ctype)->mask[__c] & __m; }
const char*
ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const
{
while (__low < __high)
*__vec++ = __OBJ_DATA(__lc_ctype)->mask[*__low++];
return __high;
}
const char*
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && !this->is(__m, *__low))
++__low;
return __low;
}
const char*
ctype<char>::
scan_not(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && this->is(__m, *__low) != 0)
++__low;
return __low;
}

View File

@ -0,0 +1,82 @@
// Locale support -*- C++ -*-
// Copyright (C) 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
// 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
const ctype_base::mask*
ctype<char>::classic_table() throw()
{ return 0; }
ctype<char>::ctype(__c_locale, 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_table(__table ? __table : classic_table())
{ }
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_table(__table ? __table : classic_table())
{ }
char
ctype<char>::do_toupper(char __c) const
{ return ::toupper((int) __c); }
const char*
ctype<char>::do_toupper(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = ::toupper((int) *__low);
++__low;
}
return __high;
}
char
ctype<char>::do_tolower(char __c) const
{ return ::tolower((int) __c); }
const char*
ctype<char>::do_tolower(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = ::tolower((int) *__low);
++__low;
}
return __high;
}

View File

@ -0,0 +1,58 @@
// Specific definitions for AIX -*- C++ -*-
// Copyright (C) 2000, 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
// 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.
#undef _XOPEN_SOURCE
#define _XOPEN_SOURCE 500
#undef _XOPEN_SOURCE_EXTENDED
#define _XOPEN_SOURCE_EXTENDED 1
// off64_t
#ifndef _LARGE_FILE_API
#define _LARGE_FILE_API
#endif
// atomic types
#ifndef _ALL_SOURCE
#define _ALL_SOURCE
#endif
#define __off_t off_t
#define __off64_t off64_t
#define __ssize_t ssize_t
#undef _G_USING_THUNKS
#define _G_USING_THUNKS 0
#endif

View File

@ -0,0 +1,76 @@
// 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
// 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 FreeBSD 3.4,
// 4.0 and all versions of the CVS managed file at:
// :pserver:anoncvs@anoncvs.freebsd.org:/home/ncvs/src/include/ctype.h
struct ctype_base
{
// Non-standard typedefs.
typedef const 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 long mask;
#ifdef _CTYPE_S
// FreeBSD 4.0 uses this style of define.
static const mask upper = _CTYPE_U;
static const mask lower = _CTYPE_L;
static const mask alpha = _CTYPE_A;
static const mask digit = _CTYPE_D;
static const mask xdigit = _CTYPE_X;
static const mask space = _CTYPE_S;
static const mask print = _CTYPE_R;
static const mask graph = _CTYPE_G;
static const mask cntrl = _CTYPE_C;
static const mask punct = _CTYPE_P;
static const mask alnum = _CTYPE_A | _CTYPE_D;
#else
// Older versions, including Free BSD 3.4, use this style of define.
static const mask upper = _U;
static const mask lower = _L;
static const mask alpha = _A;
static const mask digit = _D;
static const mask xdigit = _X;
static const mask space = _S;
static const mask print = _R;
static const mask graph = _G;
static const mask cntrl = _C;
static const mask punct = _P;
static const mask alnum = _A | _D;
#endif
};

View File

@ -0,0 +1,106 @@
// Locale support -*- C++ -*-
// Copyright (C) 2000, 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
// 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
{
if (_M_table)
return _M_table[static_cast<unsigned char>(__c)] & __m;
else
return __istype(__c, __m);
}
const char*
ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const
{
if (_M_table)
while (__low < __high)
*__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
else
for (;__low < __high; ++__vec, ++__low)
{
#if defined (_CTYPE_S) || defined (__istype)
*__vec = __maskrune (*__low, upper | lower | alpha | digit | xdigit
| space | print | graph | cntrl | punct | alnum);
#else
mask __m = 0;
if (this->is(upper, *__low)) __m |= upper;
if (this->is(lower, *__low)) __m |= lower;
if (this->is(alpha, *__low)) __m |= alpha;
if (this->is(digit, *__low)) __m |= digit;
if (this->is(xdigit, *__low)) __m |= xdigit;
if (this->is(space, *__low)) __m |= space;
if (this->is(print, *__low)) __m |= print;
if (this->is(graph, *__low)) __m |= graph;
if (this->is(cntrl, *__low)) __m |= cntrl;
if (this->is(punct, *__low)) __m |= punct;
// Do not include explicit line for alnum mask since it is a
// pure composite of masks on FreeBSD.
*__vec = __m;
#endif
}
return __high;
}
const char*
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const
{
if (_M_table)
while (__low < __high
&& !(_M_table[static_cast<unsigned char>(*__low)] & __m))
++__low;
else
while (__low < __high && !this->is(__m, *__low))
++__low;
return __low;
}
const char*
ctype<char>::
scan_not(mask __m, const char* __low, const char* __high) const
{
if (_M_table)
while (__low < __high
&& (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
++__low;
else
while (__low < __high && this->is(__m, *__low) != 0)
++__low;
return __low;
}

View File

@ -0,0 +1,81 @@
// Locale support -*- C++ -*-
// Copyright (C) 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
// 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
const ctype_base::mask*
ctype<char>::classic_table() throw()
{ return 0; }
ctype<char>::ctype(__c_locale, 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_table(__table ? __table : classic_table())
{ }
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_table(__table ? __table : classic_table())
{ }
char
ctype<char>::do_toupper(char __c) const
{ return ::toupper((int) __c); }
const char*
ctype<char>::do_toupper(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = ::toupper((int) *__low);
++__low;
}
return __high;
}
char
ctype<char>::do_tolower(char __c) const
{ return ::tolower((int) __c); }
const char*
ctype<char>::do_tolower(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = ::tolower((int) *__low);
++__low;
}
return __high;
}

View File

@ -0,0 +1,44 @@
// Specific definitions for BSD -*- C++ -*-
// Copyright (C) 2000, 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
// 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 1
// System-specific #define, typedefs, corrections, etc, go here. This
// file will come before all others.
#define _GLIBCPP_USE_C99_CHECK 1
#define _GLIBCPP_USE_C99_DYNAMIC (!(__ISO_C_VISIBLE >= 1999))
#define _GLIBCPP_USE_C99_LONG_LONG_CHECK 1
#define _GLIBCPP_USE_C99_LONG_LONG_DYNAMIC (_GLIBCPP_USE_C99_DYNAMIC || !defined __LONG_LONG_SUPPORTED)
#define _GLIBCPP_USE_C99_FLOAT_TRANSCENDENTALS_CHECK 1
#define _GLIBCPP_USE_C99_FLOAT_TRANSCENDENTALS_DYNAMIC defined _XOPEN_SOURCE
#endif

View File

@ -0,0 +1,58 @@
// 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
// 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 NetBSD.
// Full details can be found from the CVS files at:
// anoncvs@anoncvs.netbsd.org:/cvsroot/basesrc/include/ctype.h
// See www.netbsd.org for details of access.
struct ctype_base
{
// Non-standard typedefs.
typedef const unsigned char* __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 = _N | _X;
static const mask space = _S;
static const mask print = _P | _U | _L | _N | _B;
static const mask graph = _P | _U | _L | _N;
static const mask cntrl = _C;
static const mask punct = _P;
static const mask alnum = _U | _L | _N;
};

View File

@ -0,0 +1,73 @@
// 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
// 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[(unsigned char)(__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 && !this->is(__m, *__low))
++__low;
return __low;
}
const char*
ctype<char>::
scan_not(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && this->is(__m, *__low) != 0)
++__low;
return __low;
}

View File

@ -0,0 +1,79 @@
// Locale support -*- C++ -*-
// Copyright (C) 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
// 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
const ctype_base::mask*
ctype<char>::classic_table() throw()
{ return 0; }
ctype<char>::ctype(__c_locale, 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_table(__table ? __table : _ctype_ + 1)
{ }
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_table(__table ? __table : _ctype_ + 1)
{ }
char
ctype<char>::do_toupper(char __c) const
{ return ::toupper((int) __c); }
const char*
ctype<char>::do_toupper(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = ::toupper((int) *__low);
++__low;
}
return __high;
}
char
ctype<char>::do_tolower(char __c) const
{ return ::tolower((int) __c); }
const char*
ctype<char>::do_tolower(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = ::tolower((int) *__low);
++__low;
}
return __high;
}

View File

@ -0,0 +1,38 @@
// Specific definitions for NetBSD -*- 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
// 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 1
// System-specific #define, typedefs, corrections, etc, go here. This
// file will come before all others.
#define __ssize_t ssize_t
#endif

View File

@ -0,0 +1,57 @@
// 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
//
struct ctype_base
{
typedef unsigned short mask;
// Non-standard typedefs.
typedef unsigned char * __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.
static const mask space = __dj_ISSPACE; // Whitespace
static const mask print = __dj_ISPRINT; // Printing
static const mask cntrl = __dj_ISCNTRL; // Control character
static const mask upper = __dj_ISUPPER; // UPPERCASE
static const mask lower = __dj_ISLOWER; // lowercase
static const mask alpha = __dj_ISALPHA; // Alphabetic
static const mask digit = __dj_ISDIGIT; // Numeric
static const mask punct = __dj_ISPUNCT; // Punctuation
static const mask xdigit = __dj_ISXDIGIT; // Hexadecimal numeric
static const mask alnum = __dj_ISALPHA; // Alphanumeric
static const mask graph = __dj_ISGRAPH; // Graphical
};

View File

@ -0,0 +1,67 @@
// 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[static_cast<unsigned char>(__c + 1)] & __m; }
const char*
ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const
{
while (__low < __high)
*__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
return __high;
}
const char*
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && !this->is(__m, *__low))
++__low;
return __low;
}
const char*
ctype<char>::
scan_not(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && this->is(__m, *__low) != 0)
++__low;
return __low;
}

View File

@ -0,0 +1,81 @@
// Locale support -*- C++ -*-
// Copyright (C) 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
// 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 <ctype.h>
const ctype_base::mask*
ctype<char>::classic_table() throw()
{ return 0; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower),
_M_table(__table ? __table : __dj_ctype_flags)
{ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower),
_M_table(__table ? __table : __dj_ctype_flags)
{ }
char
ctype<char>::do_toupper(char __c) const
{ return _M_toupper[static_cast<int>(__c)+1]; }
const char*
ctype<char>::do_toupper(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = ::toupper(static_cast<int> (*__low));
++__low;
}
return __high;
}
char
ctype<char>::do_tolower(char __c) const
{ return _M_tolower[static_cast<int>(__c)+1]; }
const char*
ctype<char>::do_tolower(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = ::tolower(static_cast<int> (*__low));
++__low;
}
return __high;
}

View File

@ -0,0 +1,45 @@
// 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 1
// 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

View File

@ -0,0 +1,58 @@
// Locale support -*- C++ -*-
// Copyright (C) 1997, 1998, 1999 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
//
// Default information, may not be appropriate for specific host.
struct ctype_base
{
// Non-standard typedefs.
typedef const 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 int mask;
static const mask upper = 1 << 0;
static const mask lower = 1 << 1;
static const mask alpha = 1 << 2;
static const mask digit = 1 << 3;
static const mask xdigit = 1 << 4;
static const mask space = 1 << 5;
static const mask print = 1 << 6;
static const mask graph = 1 << 7;
static const mask cntrl = 1 << 8;
static const mask punct = 1 << 9;
static const mask alnum = 1 << 10;
};

View File

@ -0,0 +1,161 @@
// Locale support -*- C++ -*-
// Copyright (C) 2000, 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
// 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
// The following definitions are portable, but insanely slow. If one
// cares at all about performance, then specialized ctype
// functionality should be added for the native os in question: see
// the config/os/bits/ctype_*.h files.
// Constructing a synthetic "C" table should be seriously considered...
bool
ctype<char>::
is(mask __m, char __c) const
{
if (_M_table)
return _M_table[static_cast<unsigned char>(__c)] & __m;
else
{
bool __ret = true;
const int __bitmasksize = 11;
int __bitcur = 0; // Lowest bitmask in ctype_base == 0
for (;__ret && __bitcur < __bitmasksize; ++__bitcur)
{
mask __bit = static_cast<mask>(1 << __bitcur);
if (__m & __bit)
{
bool __testis;
switch (__bit)
{
case space:
__testis = isspace(__c);
break;
case print:
__testis = isprint(__c);
break;
case cntrl:
__testis = iscntrl(__c);
break;
case upper:
__testis = isupper(__c);
break;
case lower:
__testis = islower(__c);
break;
case alpha:
__testis = isalpha(__c);
break;
case digit:
__testis = isdigit(__c);
break;
case punct:
__testis = ispunct(__c);
break;
case xdigit:
__testis = isxdigit(__c);
break;
case alnum:
__testis = isalnum(__c);
break;
case graph:
__testis = isgraph(__c);
break;
default:
__testis = false;
break;
}
__ret &= __testis;
}
}
return __ret;
}
}
const char*
ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const
{
if (_M_table)
while (__low < __high)
*__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
else
{
// Highest bitmask in ctype_base == 10.
const int __bitmasksize = 11;
for (;__low < __high; ++__vec, ++__low)
{
mask __m = 0;
// Lowest bitmask in ctype_base == 0
int __i = 0;
for (;__i < __bitmasksize; ++__i)
{
mask __bit = static_cast<mask>(1 << __i);
if (this->is(__bit, *__low))
__m |= __bit;
}
*__vec = __m;
}
}
return __high;
}
const char*
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const
{
if (_M_table)
while (__low < __high
&& !(_M_table[static_cast<unsigned char>(*__low)] & __m))
++__low;
else
while (__low < __high && !this->is(__m, *__low))
++__low;
return __low;
}
const char*
ctype<char>::
scan_not(mask __m, const char* __low, const char* __high) const
{
if (_M_table)
while (__low < __high
&& (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
++__low;
else
while (__low < __high && this->is(__m, *__low) != 0)
++__low;
return __low;
}

View File

@ -0,0 +1,82 @@
// Locale support -*- C++ -*-
// 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
// 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
const ctype_base::mask*
ctype<char>::classic_table() throw()
{ return 0; }
ctype<char>::ctype(__c_locale, 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_table(__table ? __table : classic_table())
{ }
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_table(__table ? __table : classic_table())
{ }
char
ctype<char>::do_toupper(char __c) const
{ return ::toupper((int) __c); }
const char*
ctype<char>::do_toupper(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = ::toupper((int) *__low);
++__low;
}
return __high;
}
char
ctype<char>::do_tolower(char __c) const
{ return ::tolower((int) __c); }
const char*
ctype<char>::do_tolower(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = ::tolower((int) *__low);
++__low;
}
return __high;
}

View File

@ -0,0 +1,37 @@
// Specific definitions for generic platforms -*- 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
// 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 1
// System-specific #define, typedefs, corrections, etc, go here. This
// file will come before all others.
#endif

View File

@ -0,0 +1,55 @@
// Locale support -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2000, 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
// 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
struct ctype_base
{
// Non-standard typedefs.
typedef const 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 short mask;
static const mask upper = _ISupper;
static const mask lower = _ISlower;
static const mask alpha = _ISalpha;
static const mask digit = _ISdigit;
static const mask xdigit = _ISxdigit;
static const mask space = _ISspace;
static const mask print = _ISprint;
static const mask graph = _ISgraph;
static const mask cntrl = _IScntrl;
static const mask punct = _ISpunct;
static const mask alnum = _ISalnum;
};

View File

@ -0,0 +1,69 @@
// Locale support -*- C++ -*-
// Copyright (C) 2000, 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
// 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[static_cast<unsigned char>(__c)] & __m; }
const char*
ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const
{
while (__low < __high)
*__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
return __high;
}
const char*
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const
{
while (__low < __high
&& !(_M_table[static_cast<unsigned char>(*__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[static_cast<unsigned char>(*__low)] & __m) != 0)
++__low;
return __low;
}

View File

@ -0,0 +1,152 @@
// Locale support -*- C++ -*-
// 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
// 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
#if _GLIBCPP_C_LOCALE_GNU
const ctype_base::mask*
ctype<char>::classic_table() throw()
{
locale::classic();
return _S_c_locale->__ctype_b;
}
#else
const ctype_base::mask*
ctype<char>::classic_table() throw()
{
const ctype_base::mask* __ret;
char* __old = strdup(setlocale(LC_CTYPE, NULL));
setlocale(LC_CTYPE, "C");
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__ret = *__ctype_b_loc();
#else
__ret = __ctype_b;
#endif
setlocale(LC_CTYPE, __old);
free(__old);
return __ret;
}
#endif
#if _GLIBCPP_C_LOCALE_GNU
ctype<char>::ctype(__c_locale __cloc, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
{
_M_c_locale_ctype = _S_clone_c_locale(__cloc);
_M_toupper = _M_c_locale_ctype->__ctype_toupper;
_M_tolower = _M_c_locale_ctype->__ctype_tolower;
_M_table = __table ? __table : _M_c_locale_ctype->__ctype_b;
}
#else
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
{
char* __old=strdup(setlocale(LC_CTYPE, NULL));
setlocale(LC_CTYPE, "C");
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
_M_toupper = *__ctype_toupper_loc();
_M_tolower = *__ctype_tolower_loc();
_M_table = __table ? __table : *__ctype_b_loc();
#else
_M_toupper = __ctype_toupper;
_M_tolower = __ctype_tolower;
_M_table = __table ? __table : __ctype_b;
#endif
setlocale(LC_CTYPE, __old);
free(__old);
_M_c_locale_ctype = _S_c_locale;
}
#endif
#if _GLIBCPP_C_LOCALE_GNU
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) :
__ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
{
_M_c_locale_ctype = _S_c_locale;
_M_toupper = _M_c_locale_ctype->__ctype_toupper;
_M_tolower = _M_c_locale_ctype->__ctype_tolower;
_M_table = __table ? __table : _M_c_locale_ctype->__ctype_b;
}
#else
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) :
__ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
{
char* __old=strdup(setlocale(LC_CTYPE, NULL));
setlocale(LC_CTYPE, "C");
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
_M_toupper = *__ctype_toupper_loc();
_M_tolower = *__ctype_tolower_loc();
_M_table = __table ? __table : *__ctype_b_loc();
#else
_M_toupper = __ctype_toupper;
_M_tolower = __ctype_tolower;
_M_table = __table ? __table : __ctype_b;
#endif
setlocale(LC_CTYPE, __old);
free(__old);
_M_c_locale_ctype = _S_c_locale;
}
#endif
char
ctype<char>::do_toupper(char __c) const
{ return _M_toupper[static_cast<unsigned char>(__c)]; }
const char*
ctype<char>::do_toupper(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = _M_toupper[static_cast<unsigned char>(*__low)];
++__low;
}
return __high;
}
char
ctype<char>::do_tolower(char __c) const
{ return _M_tolower[static_cast<unsigned char>(__c)]; }
const char*
ctype<char>::do_tolower(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = _M_tolower[static_cast<unsigned char>(*__low)];
++__low;
}
return __high;
}

View File

@ -0,0 +1,68 @@
// Specific definitions for GNU/Linux -*- C++ -*-
// Copyright (C) 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
// 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 1
// System-specific #define, typedefs, corrections, etc, go here. This
// file will come before all others.
// This keeps isanum, et al from being propagated as macros.
#define __NO_CTYPE 1
#include <features.h>
#if !defined (__GLIBC__) || (__GLIBC__ == 2 && __GLIBC_MINOR__+ 0 == 0)
// The types __off_t and __off64_t are not defined through <sys/types.h>
// as _G_config assumes. For libc5 and glibc 2.0 instead use
// <gnu/types.h> and the old name for __off64_t.
#include <gnu/types.h>
typedef __loff_t __off64_t;
// These systems have declarations mismatching those in libio.h by
// omitting throw qualifiers. Cleanest way out is to not provide
// throw-qualifiers at all. Defining it as empty here will make libio.h
// not define it.
#undef __THROW
#define __THROW
// Tell Glibc not to try to provide its own inline versions of
// some math functions. Those cause assembly-time clashes with
// our definitions.
#define __NO_MATH_INLINES
#endif
#if defined __GLIBC__ && __GLIBC__ >= 2
// We must not see the optimized string functions GNU libc defines.
#define __NO_STRING_INLINES
#endif
#endif

View File

@ -0,0 +1,55 @@
// Locale support -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 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
// 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
//
// Default information, may not be appropriate for specific host.
struct ctype_base
{
// Non-standard typedefs.
typedef const 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 int mask;
static const mask upper = _ISUPPER;
static const mask lower = _ISLOWER;
static const mask alpha = _ISALPHA;
static const mask digit = _ISDIGIT;
static const mask xdigit = _ISXDIGIT;
static const mask space = _ISSPACE;
static const mask print = _ISPRINT;
static const mask graph = _ISGRAPH;
static const mask cntrl = _ISCNTRL;
static const mask punct = _ISPUNCT;
static const mask alnum = _ISALNUM;
};

View File

@ -0,0 +1,69 @@
// Locale support -*- C++ -*-
// Copyright (C) 2000, 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
// 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[static_cast<unsigned char>(__c)] & __m; }
const char*
ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const
{
while (__low < __high)
*__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
return __high;
}
const char*
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const
{
while (__low < __high
&& !(_M_table[static_cast<unsigned char>(*__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[static_cast<unsigned char>(*__low)] & __m) != 0)
++__low;
return __low;
}

View File

@ -0,0 +1,82 @@
// Locale support -*- C++ -*-
// 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
// 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
const ctype_base::mask*
ctype<char>::classic_table() throw()
{ return __SB_masks; }
ctype<char>::ctype(__c_locale, 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_table(__table ? __table : (const mask *) __SB_masks)
{ }
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_table(__table ? __table : (const mask *) __SB_masks)
{ }
char
ctype<char>::do_toupper(char __c) const
{ return ::toupper((int) __c); }
const char*
ctype<char>::do_toupper(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = ::toupper((int) *__low);
++__low;
}
return __high;
}
char
ctype<char>::do_tolower(char __c) const
{ return ::tolower((int) __c); }
const char*
ctype<char>::do_tolower(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = ::tolower((int) *__low);
++__low;
}
return __high;
}

View File

@ -0,0 +1,104 @@
// Specific definitions for HPUX -*- C++ -*-
// Copyright (C) 2000, 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
// 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 1
// 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
// Use macro form of ctype functions to ensure __SB_masks is defined.
#define _SB_CTYPE_MACROS 1
/* HP-UX, for reasons unknown choose to use a different name for
the string to [unsigned] long long conversion routines.
Furthermore, instead of having the prototypes in stdlib.h like
everyone else, they put them into a non-standard header
<inttypes.h>. Ugh.
<inttypes.h> defines a variety of things, some of which we
probably do not want. So we don't want to include it here.
Luckily we can just declare strtoll and strtoull with the
__asm extension which effectively renames calls at the
source level without namespace pollution.
Also note that the compiler defines _INCLUDE_LONGLONG for C++
unconditionally, which makes intmax_t and uintmax_t long long
types.
We also force _GLIBCPP_USE_LONG_LONG here so that we don't have
to bastardize configure to deal with this sillyness. */
namespace std
{
#ifndef __LP64__
__extension__ extern "C" long long strtoll (const char *, char **, int)
__asm ("__strtoll");
__extension__ extern "C" unsigned long long strtoull (const char *, char **, int)
__asm ("__strtoull");
#else
__extension__ extern "C" long long strtoll (const char *, char **, int)
__asm ("strtol");
__extension__ extern "C" unsigned long long strtoull (const char *, char **, int)
__asm ("strtoul");
#endif
}
#define _GLIBCPP_USE_LONG_LONG 1
// HPUX on IA64 requires vtable to be 64 bit aligned even at 32 bit
// mode. We need to pad the vtable structure to achieve this.
#if !defined(_LP64) && defined (__ia64__)
#define _GLIBCPP_VTABLE_PADDING 8
typedef long int __padding_type;
#endif
// GCC on IA64 HP-UX uses the HP-UX system unwind library,
// it does not have the _Unwind_Resume_or_Rethrow entry point
// because that is not part of the standard IA64 Unwind ABI.
#if defined (__ia64__)
#define _LIBUNWIND_STD_ABI 1
#endif
/* We need explicit instantiation of the atomicity lock on HPPA if
there is no weak support. */
#if !defined(_GLIBCPP_SUPPORTS_WEAK) && defined (__hppa__)
#define _GLIBCPP_INST_ATOMICITY_LOCK 1
#endif
/* Don't use pragma weak in gthread headers. */
#ifdef __hppa__
#define _GLIBCPP_GTHREAD_USE_WEAK 0
#endif
#endif

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,67 @@
// Locale support -*- C++ -*-
// Copyright (C) 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
// 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)[static_cast<unsigned char>(__c)] & __m; }
const char*
ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const
{
while (__low < __high)
*__vec++ = (_M_table)[static_cast<unsigned char>(*__low++)];
return __high;
}
const char*
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && ! this->is(__m, *__low))
++__low;
return __low;
}
const char*
ctype<char>::
scan_not(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && this->is(__m, *__low))
++__low;
return __low;
}

View File

@ -0,0 +1,83 @@
// Locale support -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 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
// 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
const ctype_base::mask*
ctype<char>::classic_table() throw()
{ return __ctype + 1; }
ctype<char>::ctype(__c_locale, 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_table(!__table ? classic_table() : __table)
{ }
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_table(!__table ? classic_table() : __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,55 @@
// Specific definitions for IRIX -*- C++ -*-
// Copyright (C) 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
// 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 1
// 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

@ -0,0 +1,50 @@
// Low-level functions for atomic operations: IRIX version -*- 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.
#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 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 6.5
struct ctype_base
{
// Non-standard typedefs.
typedef 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 int mask;
static const mask upper = _ISupper;
static const mask lower = _ISlower;
static const mask alpha = _ISalpha;
static const mask digit = _ISdigit;
static const mask xdigit = _ISxdigit;
static const mask space = _ISspace;
static const mask print = _ISprint;
static const mask graph = _ISgraph;
static const mask cntrl = _IScntrl;
static const mask punct = _ISpunct;
static const mask alnum = _ISalnum;
};

View File

@ -0,0 +1,67 @@
// Locale support -*- C++ -*-
// Copyright (C) 2000, 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
// 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)[static_cast<unsigned char>(__c)] & __m; }
const char*
ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const
{
while (__low < __high)
*__vec++ = (_M_table)[static_cast<unsigned char>(*__low++)];
return __high;
}
const char*
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && ! this->is(__m, *__low))
++__low;
return __low;
}
const char*
ctype<char>::
scan_not(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && this->is(__m, *__low))
++__low;
return __low;
}

View File

@ -0,0 +1,84 @@
// Locale support -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 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
// 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
const ctype_base::mask*
ctype<char>::classic_table() throw()
{ return 0; }
ctype<char>::ctype(__c_locale, 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_table(!__table ?
(const mask*) (__libc_attr._ctype_tbl->_class + 1) : __table)
{ }
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_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;
}

View File

@ -0,0 +1,55 @@
// Specific definitions for IRIX -*- C++ -*-
// Copyright (C) 2000, 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
// 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 1
// 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

@ -0,0 +1,58 @@
// Locale support -*- C++ -*-
// Copyright (C) 1997, 1998, 1999 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 /mingw32/include/ctype.h.
struct ctype_base
{
// Non-standard typedefs.
typedef const 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 short mask;
static const mask upper = _UPPER;
static const mask lower = _LOWER;
static const mask alpha = _ALPHA;
static const mask digit = _DIGIT;
static const mask xdigit = _HEX;
static const mask space = _SPACE;
static const mask print = (_BLANK | _PUNCT| _ALPHA | _DIGIT);
static const mask graph = (_PUNCT | _ALPHA | _DIGIT);
static const mask cntrl = _CONTROL;
static const mask punct = _PUNCT;
static const mask alnum = (_ALPHA | _DIGIT);
};

View File

@ -0,0 +1,71 @@
// 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
// 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[static_cast<unsigned char>(__c) ] & __m);
}
const char*
ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const
{
while (__low < __high)
*__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
return __high;
}
const char*
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && !this->is(__m, *__low))
++__low;
return __low;
}
const char*
ctype<char>::
scan_not(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && this->is(__m, *__low) != 0)
++__low;
return __low;
}

View File

@ -0,0 +1,89 @@
// Locale support -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2000, 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
// 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 /mingw32/include/ctype.h.
// This should be in mingw's ctype.h but isn't in older versions
// Static classic C-locale table. _ctype[0] is EOF
extern "C" unsigned short __declspec(dllimport) _ctype[];
const ctype_base::mask*
ctype<char>::classic_table() throw()
{ return _ctype + 1; }
ctype<char>::ctype(__c_locale, 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_table(__table ? __table : classic_table())
{ }
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_table(__table ? __table : classic_table())
{ }
char
ctype<char>::do_toupper(char __c) const
{ return (this->is(ctype_base::lower, __c) ? (__c - 'a' + 'A') : __c); }
const char*
ctype<char>::do_toupper(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = this->do_toupper(*__low);
++__low;
}
return __high;
}
char
ctype<char>::do_tolower(char __c) const
{ return (this->is(ctype_base::upper, __c) ? (__c - 'A' + 'a') : __c); }
const char*
ctype<char>::do_tolower(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = this->do_tolower(*__low);
++__low;
}
return __high;
}

View File

@ -0,0 +1,37 @@
// Specific definitions for generic platforms -*- 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
// 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.
#endif

View File

@ -0,0 +1,57 @@
// 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
// 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, for solaris2.5.1
// Support for Solaris 2.5.1
struct ctype_base
{
// Non-standard typedefs.
typedef const 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 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 | _N;
static const mask space = _S;
static const mask print = _P | _U | _L | _N | _B;
static const mask graph = _P | _U | _L | _N;
static const mask cntrl = _C;
static const mask punct = _P;
static const mask alnum = _U | _L | _N;
};

View File

@ -0,0 +1,67 @@
// Locale support -*- C++ -*-
// Copyright (C) 2000, 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
// 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[static_cast<unsigned char>(__c)] & __m; }
const char*
ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const
{
while (__low < __high)
*__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
return __high;
}
const char*
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && !this->is(__m, *__low))
++__low;
return __low;
}
const char*
ctype<char>::
scan_not(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && this->is(__m, *__low) != 0)
++__low;
return __low;
}

View File

@ -0,0 +1,88 @@
// Locale support -*- C++ -*-
// Copyright (C) 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
// 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
const ctype_base::mask*
ctype<char>::classic_table() throw()
{ return _ctype_ + 1; }
ctype<char>::ctype(__c_locale, 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_table(__table ? __table : classic_table())
{ }
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_table(__table ? __table : classic_table())
{ }
char
ctype<char>::do_toupper(char __c) const
{
int __x = __c;
return (this->is(ctype_base::lower, __c) ? (__x - 'a' + 'A') : __x);
}
const char*
ctype<char>::do_toupper(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = this->do_toupper(*__low);
++__low;
}
return __high;
}
char
ctype<char>::do_tolower(char __c) const
{
int __x = __c;
return (this->is(ctype_base::upper, __c) ? (__x - 'A' + 'a') : __x);
}
const char*
ctype<char>::do_tolower(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = this->do_tolower(*__low);
++__low;
}
return __high;
}

View File

@ -0,0 +1,36 @@
// Specific definitions for newlib -*- 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
// 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 1
// System-specific #define, typedefs, corrections, etc, go here. This
// file will come before all others.
#endif

View File

@ -0,0 +1,55 @@
// Locale support -*- C++ -*-
// 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
// 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.
struct ctype_base
{
// Non-standard typedefs.
typedef const unsigned char* __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 short mask;
static const mask upper = _UP;
static const mask lower = _LO;
static const mask alpha = _LO | _UP | _XA;
static const mask digit = _DI;
static const mask xdigit = _XD;
static const mask space = _CN | _SP | _XS;
static const mask print = _DI | _LO | _PU | _SP | _UP | _XA;
static const mask graph = _DI | _LO | _PU | _UP | _XA;
static const mask cntrl = _BB;
static const mask punct = _PU;
static const mask alnum = _DI | _LO | _UP | _XA;
};

View File

@ -0,0 +1,67 @@
// Locale support -*- C++ -*-
// 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
// 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[(unsigned char)(__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 && !this->is(__m, *__low))
++__low;
return __low;
}
const char*
ctype<char>::
scan_not(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && this->is(__m, *__low) != 0)
++__low;
return __low;
}

View File

@ -0,0 +1,79 @@
// Locale support -*- C++ -*-
// 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
// 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
const ctype_base::mask*
ctype<char>::classic_table() throw()
{ return 0; }
ctype<char>::ctype(__c_locale, 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_table(__table ? __table : _Ctype)
{ }
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_table(__table ? __table : _Ctype)
{ }
char
ctype<char>::do_toupper(char __c) const
{ return ::toupper((int) __c); }
const char*
ctype<char>::do_toupper(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = ::toupper((int) *__low);
++__low;
}
return __high;
}
char
ctype<char>::do_tolower(char __c) const
{ return ::tolower((int) __c); }
const char*
ctype<char>::do_tolower(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = ::tolower((int) *__low);
++__low;
}
return __high;
}

View File

@ -0,0 +1,36 @@
// Specific definitions for QNX 6.1 -*- C++ -*-
// 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
// 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 1
// System-specific #define, typedefs, corrections, etc, go here. This
// file will come before all others.
#endif

View File

@ -0,0 +1,55 @@
// Locale support -*- C++ -*-
// Copyright (C) 1997-1999, 2000, 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
// 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, for solaris2.5.1
struct ctype_base
{
// Non-standard typedefs.
typedef const 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 = 01;
static const mask lower = 02;
static const mask alpha = 01 | 02;
static const mask digit = 04;
static const mask xdigit = 0200;
static const mask space = 010;
static const mask print = 020 | 01 | 02 | 04 | 0100;
static const mask graph = 020 | 01 | 02 | 04;
static const mask cntrl = 040;
static const mask punct = 020;
static const mask alnum = 01 | 02 | 04;
};

View File

@ -0,0 +1,69 @@
// Locale support -*- C++ -*-
// Copyright (C) 1997-1999, 2000, 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
// 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 + 1)[static_cast<unsigned char>(__c)] & __m; }
const char*
ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const
{
while (__low < __high)
*__vec++ = (_M_table + 1)[static_cast<unsigned char>(*__low++)];
return __high;
}
const char*
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const
{
while (__low < __high
&& !((_M_table + 1)[static_cast<unsigned char>(*__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)[static_cast<unsigned char>(*__low)] & __m) != 0)
++__low;
return __low;
}

View File

@ -0,0 +1,81 @@
// Locale support -*- C++ -*-
// Copyright (C) 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
// 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
const ctype_base::mask*
ctype<char>::classic_table() throw()
{ return __ctype; }
ctype<char>::ctype(__c_locale, 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_table(__table ? __table : classic_table())
{ }
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_table(__table ? __table : classic_table())
{ }
char
ctype<char>::do_toupper(char __c) const
{ return ((_M_table + 258)[static_cast<unsigned char>(__c)]); }
const char*
ctype<char>::do_toupper(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = this->do_toupper(*__low);
++__low;
}
return __high;
}
char
ctype<char>::do_tolower(char __c) const
{ return ((_M_table + 258)[static_cast<unsigned char>(__c)]); }
const char*
ctype<char>::do_tolower(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = this->do_tolower(*__low);
++__low;
}
return __high;
}

View File

@ -0,0 +1,42 @@
// Specific definitions for Solaris 2.5 -*- C++ -*-
// Copyright (C) 2000, 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
// 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 1
// System-specific #define, typedefs, corrections, etc, go here. This
// file will come before all others.
// These are typedefs which libio assumes are already in place (because
// they really are, under Linux).
#define __off_t off_t
#define __off64_t off64_t
#define __ssize_t ssize_t
#endif

Some files were not shown because too many files have changed in this diff Show More