mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-22 21:31:19 +08:00
libsupc++: New directory.
2000-10-06 Benjamin Kosnik <bkoz@cygnus.com> Richard Henderson <rth@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * libsupc++: New directory. * libsupc++/*: Populate. * libsupc++/Makefile.am (INCLUDES): Add -I../../gcc for eh-common.h, gansidecl.h. * configure.in: Add in libsupc++/Makefile to AC_OUTPUT. * configure: Regenerate. * Makefile.am (SUBDIRS): Add libsupc++. * Makefile.in: Regenerate. * src/Makefile.am (libstdc___la_LIBADD): Add in libsupc++.la * src/Makefile.in: Regenerate. * libio/Makefile.am: Remove extraneous, confusing bits. * libio/Makefile.in: Regeneate. From-SVN: r36763
This commit is contained in:
parent
4071f896a0
commit
06bd10fb63
@ -1,3 +1,20 @@
|
||||
2000-10-06 Benjamin Kosnik <bkoz@cygnus.com>
|
||||
Richard Henderson <rth@cygnus.com>
|
||||
Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
* libsupc++: New directory.
|
||||
* libsupc++/*: Populate.
|
||||
* libsupc++/Makefile.am (INCLUDES): Add -I../../gcc for
|
||||
eh-common.h, gansidecl.h.
|
||||
* configure.in: Add in libsupc++/Makefile to AC_OUTPUT.
|
||||
* configure: Regenerate.
|
||||
* Makefile.am (SUBDIRS): Add libsupc++.
|
||||
* Makefile.in: Regenerate.
|
||||
* src/Makefile.am (libstdc___la_LIBADD): Add in libsupc++.la
|
||||
* src/Makefile.in: Regenerate.
|
||||
* libio/Makefile.am: Remove extraneous, confusing bits.
|
||||
* libio/Makefile.in: Regeneate.
|
||||
|
||||
2000-10-05 Brent Verner <brent@rcfile.org>
|
||||
|
||||
* bits/istream.tcc [basic_istream::get(basic_streambuf&)]: Removed
|
||||
|
@ -29,7 +29,7 @@ MAINT_CHARSET = latin1
|
||||
INTERFACE = v3
|
||||
gxx_include_dir=$(includedir)/g++
|
||||
|
||||
SUBDIRS = math libio src
|
||||
SUBDIRS = math libio libsupc++ src
|
||||
|
||||
# Use $(blddir) instead of $(top_builddir) for arguments to "mkcheck"
|
||||
# because then the paths will be full pathnames, not relative
|
||||
|
@ -117,7 +117,7 @@ MAINT_CHARSET = latin1
|
||||
INTERFACE = v3
|
||||
gxx_include_dir = $(includedir)/g++
|
||||
|
||||
SUBDIRS = math libio src
|
||||
SUBDIRS = math libio libsupc++ src
|
||||
|
||||
#all-local: stamp-rebuild
|
||||
|
||||
|
2013
libstdc++-v3/configure
vendored
2013
libstdc++-v3/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -148,7 +148,7 @@ fi
|
||||
# -> top_srcdir/Makefile.am -> top_srcdir/src/Makefile.am, manually
|
||||
# append it here.
|
||||
|
||||
AC_OUTPUT(mkcheck Makefile src/Makefile math/Makefile libio/Makefile,
|
||||
AC_OUTPUT(mkcheck Makefile src/Makefile math/Makefile libio/Makefile libsupc++/Makefile,
|
||||
[if test -n "$CONFIG_FILES"; then
|
||||
ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
|
||||
grep '^MULTISUBDIR =' Makefile >> src/Makefile
|
||||
|
@ -1,3 +1,8 @@
|
||||
2000-10-06 Benjamin Kosnik <bkoz@gnu.org>
|
||||
|
||||
* Makefile.am (libio_la_DEPENDENCIES): Remove extaneous cruft.
|
||||
(libio_la_SOURCES): Remove.
|
||||
|
||||
2000-10-05 Benjamin Kosnik <bkoz@gnu.org>
|
||||
|
||||
* Makefile.am (INCLUDES): Add glibcpp_includedir.
|
||||
|
@ -96,7 +96,11 @@ endif
|
||||
|
||||
EXTRA_DIST = iostreamP.h
|
||||
|
||||
libio_la_LIBADD = $(LIBIO_SRCS) $(LIBIO_WSRCS) $(LIBIO_XTRASRCS)
|
||||
libio_la_DEPENDENCIES = $(libio_la_LIBADD)
|
||||
libio_la_SOURCES = $(LIBIO_SRCS) $(LIBIO_WSRCS) $(LIBIO_XTRASRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -159,8 +159,6 @@ libio_headers = libio.h libioP.h iolibio.h
|
||||
|
||||
EXTRA_DIST = iostreamP.h
|
||||
|
||||
libio_la_LIBADD = $(LIBIO_SRCS) $(LIBIO_WSRCS) $(LIBIO_XTRASRCS)
|
||||
libio_la_DEPENDENCIES = $(libio_la_LIBADD)
|
||||
libio_la_SOURCES = $(LIBIO_SRCS) $(LIBIO_WSRCS) $(LIBIO_XTRASRCS)
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
|
||||
CONFIG_HEADER = ../config.h
|
||||
@ -173,6 +171,7 @@ CPPFLAGS = @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBS = @LIBS@
|
||||
libio_la_LDFLAGS =
|
||||
libio_la_LIBADD =
|
||||
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@@GLIBCPP_NEED_LIBIO_FALSE@libio_la_OBJECTS =
|
||||
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@@GLIBCPP_NEED_LIBIO_FALSE@libio_la_OBJECTS = \
|
||||
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@@GLIBCPP_NEED_LIBIO_FALSE@iofwide.lo \
|
||||
|
109
libstdc++-v3/libsupc++/Makefile.am
Normal file
109
libstdc++-v3/libsupc++/Makefile.am
Normal file
@ -0,0 +1,109 @@
|
||||
## Makefile for the GNU C++ Support library.
|
||||
##
|
||||
## Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
##
|
||||
## Process this file with automake to produce Makefile.in.
|
||||
##
|
||||
## This file is part of GNU CC.
|
||||
##
|
||||
## GNU CC 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.
|
||||
##
|
||||
## GNU CC 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 GNU CC; see the file COPYING. If not, write to
|
||||
## the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
## Boston, MA 02111-1307, USA.
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.3 cygnus
|
||||
MAINT_CHARSET = latin1
|
||||
|
||||
# Cross compiler and multilib support.
|
||||
# Install a library built with a cross compiler in tooldir, not libdir.
|
||||
if USE_LIBDIR
|
||||
toolexeclibdir = $(libdir)$(MULTISUBDIR)
|
||||
else
|
||||
toolexecdir = $(exec_prefix)/$(target_alias)
|
||||
toolexeclibdir = $(toolexecdir)/lib$(MULTISUBDIR)
|
||||
endif
|
||||
|
||||
|
||||
# Need this library to both be part of libstdc++.a, and installed
|
||||
# separately too.
|
||||
# 1) separate libsupc++.la
|
||||
toolexeclib_LTLIBRARIES = libsupc++.la
|
||||
# 2) integrated libsupc++convenience.la that is to be a part of libstdc++.a
|
||||
noinst_LTLIBRARIES = libsupc++convenience.la
|
||||
|
||||
|
||||
INCLUDES = \
|
||||
-I$(top_srcdir)/../gcc -I$(top_srcdir)/libsupc++/include \
|
||||
$(CONFIG_INCLUDES)
|
||||
|
||||
headers = \
|
||||
include/cxxabi.h \
|
||||
include/exception \
|
||||
include/new \
|
||||
include/new.h \
|
||||
include/typeinfo
|
||||
|
||||
sources = \
|
||||
del_op.cc \
|
||||
del_opnt.cc \
|
||||
del_opv.cc \
|
||||
del_opvnt.cc \
|
||||
exception.cc \
|
||||
new_handler.cc \
|
||||
new_op.cc \
|
||||
new_opnt.cc \
|
||||
new_opv.cc \
|
||||
new_opvnt.cc \
|
||||
tinfo.cc \
|
||||
tinfo2.cc \
|
||||
vec.cc
|
||||
|
||||
libsupc___la_SOURCES = $(sources)
|
||||
libsupc__convenience_la_SOURCES = $(sources)
|
||||
|
||||
# Flags to force separate libtool library to be static only.
|
||||
LIBTOOL = @LIBTOOL@ --tag disable-shared
|
||||
LIBSUPCXX_CXXFLAGS = -prefer-pic
|
||||
|
||||
|
||||
# These bits are all figured out from configure. Look in acinclude.m4
|
||||
# or configure.in to see how they are set.
|
||||
# NB: DEBUGFLAGS have to be at the end so that -O2 can be overridden.
|
||||
AC_CXXFLAGS = \
|
||||
$(WERROR) @WFMT_FLAGS@ @CPU_FLAGS@ @EXTRA_CXX_FLAGS@ \
|
||||
@SECTION_FLAGS@ @CSHADOWFLAGS@ @DEBUG_FLAGS@
|
||||
|
||||
# Need to manually set this option because AC_CXXFLAGS has to be at
|
||||
# the end of the compile line so that -O2 can be overridden as the
|
||||
# occasion call for it. (ie, --enable-debug)
|
||||
AM_CXXFLAGS = \
|
||||
-fno-implicit-templates $(OPTIMIZE_CXXFLAGS) \
|
||||
-Wall -Wno-format -W -Wwrite-strings -Winline \
|
||||
$(LIBSUPCXX_CXXFLAGS) $(AC_CXXFLAGS)
|
||||
|
||||
# Need to explicitly set this so that AM_CXXFLAGS is last. In
|
||||
# addition, we don't use $(DEFS), which tries to set $(top_srcdir) as
|
||||
# an include diretory, which screws up shadow headers. (That way,
|
||||
# things like -O2 passed down from the toplevel can be overridden by
|
||||
# --enable-debug.)
|
||||
CXXCOMPILE = $(CXX) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(CXXFLAGS) $(AM_CXXFLAGS)
|
||||
|
||||
LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
|
||||
|
||||
# We have a problem when building the shared libstdc++ object if the
|
||||
# rules automake generates would be used. We cannot allow CXX to be used
|
||||
# in libtool since this would add -lstdc++ to the link line which of
|
||||
# course is impossible.
|
||||
CXXLINK = $(LIBTOOL) --mode=link "$(CC)" @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@
|
432
libstdc++-v3/libsupc++/Makefile.in
Normal file
432
libstdc++-v3/libsupc++/Makefile.in
Normal file
@ -0,0 +1,432 @@
|
||||
# Makefile.in generated automatically by automake 1.4 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = ..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_alias = @build_alias@
|
||||
build_triplet = @build@
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
target_alias = @target_alias@
|
||||
target_triplet = @target@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
CC = @CC@
|
||||
CPP = @CPP@
|
||||
CPU_FLAGS = @CPU_FLAGS@
|
||||
CSHADOWFLAGS = @CSHADOWFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
DEBUG_FLAGS = @DEBUG_FLAGS@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
EXEEXT = @EXEEXT@
|
||||
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
|
||||
GCC_OBJDIR = @GCC_OBJDIR@
|
||||
GCJ = @GCJ@
|
||||
GCJFLAGS = @GCJFLAGS@
|
||||
GLIBCPP_CFLAGS = @GLIBCPP_CFLAGS@
|
||||
GLIBCPP_CXXFLAGS = @GLIBCPP_CXXFLAGS@
|
||||
LIBMATHOBJS = @LIBMATHOBJS@
|
||||
LIBSTRINGOBJS = @LIBSTRINGOBJS@
|
||||
LN_S = @LN_S@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OPT_LDFLAGS = @OPT_LDFLAGS@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
SECTION_FLAGS = @SECTION_FLAGS@
|
||||
SECTION_LDFLAGS = @SECTION_LDFLAGS@
|
||||
STRIP = @STRIP@
|
||||
THREADDEPS = @THREADDEPS@
|
||||
THREADINCS = @THREADINCS@
|
||||
THREADLIBS = @THREADLIBS@
|
||||
THREADOBJS = @THREADOBJS@
|
||||
THREADSPEC = @THREADSPEC@
|
||||
USE_COMPLEX_LONG_DOUBLE = @USE_COMPLEX_LONG_DOUBLE@
|
||||
VERSION = @VERSION@
|
||||
WERROR = @WERROR@
|
||||
WFMT_FLAGS = @WFMT_FLAGS@
|
||||
cpu_include_dir = @cpu_include_dir@
|
||||
ctype_include_dir = @ctype_include_dir@
|
||||
glibcpp_basedir = @glibcpp_basedir@
|
||||
ifGNUmake = @ifGNUmake@
|
||||
libinst_wstring_la = @libinst_wstring_la@
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.3 cygnus
|
||||
MAINT_CHARSET = latin1
|
||||
@USE_LIBDIR_TRUE@toolexeclibdir = $(libdir)$(MULTISUBDIR)
|
||||
@USE_LIBDIR_FALSE@toolexeclibdir = $(toolexecdir)/lib$(MULTISUBDIR)
|
||||
@USE_LIBDIR_FALSE@toolexecdir = $(exec_prefix)/$(target_alias)
|
||||
|
||||
# Need this library to both be part of libstdc++.a, and installed
|
||||
# separately too.
|
||||
# 1) separate libsupc++.la
|
||||
toolexeclib_LTLIBRARIES = libsupc++.la
|
||||
# 2) integrated libsupc++convenience.la that is to be a part of libstdc++.a
|
||||
noinst_LTLIBRARIES = libsupc++convenience.la
|
||||
|
||||
INCLUDES = -I$(top_srcdir)/../gcc -I$(top_srcdir)/libsupc++/include $(CONFIG_INCLUDES)
|
||||
|
||||
|
||||
headers = include/cxxabi.h include/exception include/new include/new.h include/typeinfo
|
||||
|
||||
|
||||
sources = del_op.cc del_opnt.cc del_opv.cc del_opvnt.cc exception.cc new_handler.cc new_op.cc new_opnt.cc new_opv.cc new_opvnt.cc tinfo.cc tinfo2.cc vec.cc
|
||||
|
||||
|
||||
libsupc___la_SOURCES = $(sources)
|
||||
libsupc__convenience_la_SOURCES = $(sources)
|
||||
|
||||
# Flags to force separate libtool library to be static only.
|
||||
LIBTOOL = @LIBTOOL@ --tag disable-shared
|
||||
LIBSUPCXX_CXXFLAGS = -prefer-pic
|
||||
|
||||
# These bits are all figured out from configure. Look in acinclude.m4
|
||||
# or configure.in to see how they are set.
|
||||
# NB: DEBUGFLAGS have to be at the end so that -O2 can be overridden.
|
||||
AC_CXXFLAGS = $(WERROR) @WFMT_FLAGS@ @CPU_FLAGS@ @EXTRA_CXX_FLAGS@ @SECTION_FLAGS@ @CSHADOWFLAGS@ @DEBUG_FLAGS@
|
||||
|
||||
|
||||
# Need to manually set this option because AC_CXXFLAGS has to be at
|
||||
# the end of the compile line so that -O2 can be overridden as the
|
||||
# occasion call for it. (ie, --enable-debug)
|
||||
AM_CXXFLAGS = -fno-implicit-templates $(OPTIMIZE_CXXFLAGS) -Wall -Wno-format -W -Wwrite-strings -Winline $(LIBSUPCXX_CXXFLAGS) $(AC_CXXFLAGS)
|
||||
|
||||
|
||||
# Need to explicitly set this so that AM_CXXFLAGS is last. In
|
||||
# addition, we don't use $(DEFS), which tries to set $(top_srcdir) as
|
||||
# an include diretory, which screws up shadow headers. (That way,
|
||||
# things like -O2 passed down from the toplevel can be overridden by
|
||||
# --enable-debug.)
|
||||
CXXCOMPILE = $(CXX) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
|
||||
|
||||
|
||||
LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
|
||||
|
||||
|
||||
# We have a problem when building the shared libstdc++ object if the
|
||||
# rules automake generates would be used. We cannot allow CXX to be used
|
||||
# in libtool since this would add -lstdc++ to the link line which of
|
||||
# course is impossible.
|
||||
CXXLINK = $(LIBTOOL) --mode=link "$(CC)" @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
|
||||
CONFIG_HEADER = ../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
LTLIBRARIES = $(noinst_LTLIBRARIES) $(toolexeclib_LTLIBRARIES)
|
||||
|
||||
|
||||
DEFS = @DEFS@ -I. -I$(srcdir) -I..
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBS = @LIBS@
|
||||
libsupc__convenience_la_LDFLAGS =
|
||||
libsupc__convenience_la_LIBADD =
|
||||
libsupc__convenience_la_OBJECTS = del_op.lo del_opnt.lo del_opv.lo \
|
||||
del_opvnt.lo exception.lo new_handler.lo new_op.lo new_opnt.lo \
|
||||
new_opv.lo new_opvnt.lo tinfo.lo tinfo2.lo vec.lo
|
||||
libsupc___la_LDFLAGS =
|
||||
libsupc___la_LIBADD =
|
||||
libsupc___la_OBJECTS = del_op.lo del_opnt.lo del_opv.lo del_opvnt.lo \
|
||||
exception.lo new_handler.lo new_op.lo new_opnt.lo new_opv.lo \
|
||||
new_opvnt.lo tinfo.lo tinfo2.lo vec.lo
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CXXLD = $(CXX)
|
||||
DIST_COMMON = Makefile.am Makefile.in configure configure.in
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = gtar
|
||||
GZIP_ENV = --best
|
||||
SOURCES = $(libsupc__convenience_la_SOURCES) $(libsupc___la_SOURCES)
|
||||
OBJECTS = $(libsupc__convenience_la_OBJECTS) $(libsupc___la_OBJECTS)
|
||||
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .S .c .cc .lo .o .obj .s
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --cygnus libsupc++/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
|
||||
mostlyclean-noinstLTLIBRARIES:
|
||||
|
||||
clean-noinstLTLIBRARIES:
|
||||
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
|
||||
|
||||
distclean-noinstLTLIBRARIES:
|
||||
|
||||
maintainer-clean-noinstLTLIBRARIES:
|
||||
|
||||
mostlyclean-toolexeclibLTLIBRARIES:
|
||||
|
||||
clean-toolexeclibLTLIBRARIES:
|
||||
-test -z "$(toolexeclib_LTLIBRARIES)" || rm -f $(toolexeclib_LTLIBRARIES)
|
||||
|
||||
distclean-toolexeclibLTLIBRARIES:
|
||||
|
||||
maintainer-clean-toolexeclibLTLIBRARIES:
|
||||
|
||||
install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(toolexeclibdir)
|
||||
@list='$(toolexeclib_LTLIBRARIES)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(toolexeclibdir)/$$p"; \
|
||||
$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(toolexeclibdir)/$$p; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-toolexeclibLTLIBRARIES:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
list='$(toolexeclib_LTLIBRARIES)'; for p in $$list; do \
|
||||
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(toolexeclibdir)/$$p; \
|
||||
done
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
# FIXME: We should only use cygpath when building on Windows,
|
||||
# and only if it is available.
|
||||
.c.obj:
|
||||
$(COMPILE) -c `cygpath -w $<`
|
||||
|
||||
.s.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.S.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.o core *.core
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
clean-compile:
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
maintainer-clean-compile:
|
||||
|
||||
.c.lo:
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) -c $<
|
||||
|
||||
.s.lo:
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) -c $<
|
||||
|
||||
.S.lo:
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) -c $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
|
||||
maintainer-clean-libtool:
|
||||
|
||||
libsupc++convenience.la: $(libsupc__convenience_la_OBJECTS) $(libsupc__convenience_la_DEPENDENCIES)
|
||||
$(CXXLINK) $(libsupc__convenience_la_LDFLAGS) $(libsupc__convenience_la_OBJECTS) $(libsupc__convenience_la_LIBADD) $(LIBS)
|
||||
|
||||
libsupc++.la: $(libsupc___la_OBJECTS) $(libsupc___la_DEPENDENCIES)
|
||||
$(CXXLINK) -rpath $(toolexeclibdir) $(libsupc___la_LDFLAGS) $(libsupc___la_OBJECTS) $(libsupc___la_LIBADD) $(LIBS)
|
||||
.cc.o:
|
||||
$(CXXCOMPILE) -c $<
|
||||
.cc.obj:
|
||||
$(CXXCOMPILE) -c `cygpath -w $<`
|
||||
.cc.lo:
|
||||
$(LTCXXCOMPILE) -c $<
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
here=`pwd` && cd $(srcdir) \
|
||||
&& mkid -f$$here/ID $$unique $(LISP)
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|
||||
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
|
||||
|
||||
mostlyclean-tags:
|
||||
|
||||
clean-tags:
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID
|
||||
|
||||
maintainer-clean-tags:
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = libsupc++
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
if test -f $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
fi; \
|
||||
done
|
||||
info-am:
|
||||
info: info-am
|
||||
dvi-am:
|
||||
dvi: dvi-am
|
||||
check-am:
|
||||
check: check-am
|
||||
installcheck-am:
|
||||
installcheck: installcheck-am
|
||||
install-info-am:
|
||||
install-info: install-info-am
|
||||
install-exec-am: install-toolexeclibLTLIBRARIES
|
||||
install-exec: install-exec-am
|
||||
|
||||
install-data-am:
|
||||
install-data: install-data-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-am
|
||||
uninstall-am: uninstall-toolexeclibLTLIBRARIES
|
||||
uninstall: uninstall-am
|
||||
all-am: Makefile $(LTLIBRARIES)
|
||||
all-redirect: all-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(toolexeclibdir)
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
|
||||
maintainer-clean-generic:
|
||||
mostlyclean-am: mostlyclean-noinstLTLIBRARIES \
|
||||
mostlyclean-toolexeclibLTLIBRARIES mostlyclean-compile \
|
||||
mostlyclean-libtool mostlyclean-tags \
|
||||
mostlyclean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
clean-am: clean-noinstLTLIBRARIES clean-toolexeclibLTLIBRARIES \
|
||||
clean-compile clean-libtool clean-tags clean-generic \
|
||||
mostlyclean-am
|
||||
|
||||
clean: clean-am
|
||||
|
||||
distclean-am: distclean-noinstLTLIBRARIES \
|
||||
distclean-toolexeclibLTLIBRARIES distclean-compile \
|
||||
distclean-libtool distclean-tags distclean-generic \
|
||||
clean-am
|
||||
-rm -f libtool
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
maintainer-clean-am: maintainer-clean-noinstLTLIBRARIES \
|
||||
maintainer-clean-toolexeclibLTLIBRARIES \
|
||||
maintainer-clean-compile maintainer-clean-libtool \
|
||||
maintainer-clean-tags maintainer-clean-generic \
|
||||
distclean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
.PHONY: mostlyclean-noinstLTLIBRARIES distclean-noinstLTLIBRARIES \
|
||||
clean-noinstLTLIBRARIES maintainer-clean-noinstLTLIBRARIES \
|
||||
mostlyclean-toolexeclibLTLIBRARIES distclean-toolexeclibLTLIBRARIES \
|
||||
clean-toolexeclibLTLIBRARIES maintainer-clean-toolexeclibLTLIBRARIES \
|
||||
uninstall-toolexeclibLTLIBRARIES install-toolexeclibLTLIBRARIES \
|
||||
mostlyclean-compile distclean-compile clean-compile \
|
||||
maintainer-clean-compile mostlyclean-libtool distclean-libtool \
|
||||
clean-libtool maintainer-clean-libtool tags mostlyclean-tags \
|
||||
distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
|
||||
dvi-am dvi check check-am installcheck-am installcheck install-info-am \
|
||||
install-info install-exec-am install-exec install-data-am install-data \
|
||||
install-am install uninstall-am uninstall all-redirect all-am all \
|
||||
installdirs mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
430
libstdc++-v3/libsupc++/aclocal.m4
vendored
Normal file
430
libstdc++-v3/libsupc++/aclocal.m4
vendored
Normal file
@ -0,0 +1,430 @@
|
||||
dnl aclocal.m4 generated automatically by aclocal 1.4
|
||||
|
||||
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl This program is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
dnl PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
# serial 40 AC_PROG_LIBTOOL
|
||||
AC_DEFUN(AC_PROG_LIBTOOL,
|
||||
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
|
||||
|
||||
# Save cache, so that ltconfig can load it
|
||||
AC_CACHE_SAVE
|
||||
|
||||
# Actually configure libtool. ac_aux_dir is where install-sh is found.
|
||||
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
|
||||
LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
|
||||
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
|
||||
DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
|
||||
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
|
||||
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
|
||||
|| AC_MSG_ERROR([libtool configure failed])
|
||||
|
||||
# Reload cache, that may have been modified by ltconfig
|
||||
AC_CACHE_LOAD
|
||||
|
||||
# This can be used to rebuild libtool when needed
|
||||
LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
|
||||
|
||||
# Always use our own libtool.
|
||||
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
|
||||
AC_SUBST(LIBTOOL)dnl
|
||||
|
||||
# Redirect the config.log output again, so that the ltconfig log is not
|
||||
# clobbered by the next message.
|
||||
exec 5>>./config.log
|
||||
])
|
||||
|
||||
AC_DEFUN(AC_LIBTOOL_SETUP,
|
||||
[AC_PREREQ(2.13)dnl
|
||||
AC_REQUIRE([AC_ENABLE_SHARED])dnl
|
||||
AC_REQUIRE([AC_ENABLE_STATIC])dnl
|
||||
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
|
||||
AC_REQUIRE([AC_PROG_RANLIB])dnl
|
||||
AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_REQUIRE([AC_PROG_LD])dnl
|
||||
AC_REQUIRE([AC_PROG_NM])dnl
|
||||
AC_REQUIRE([AC_PROG_LN_S])dnl
|
||||
dnl
|
||||
|
||||
case "$target" in
|
||||
NONE) lt_target="$host" ;;
|
||||
*) lt_target="$target" ;;
|
||||
esac
|
||||
|
||||
# Check for any special flags to pass to ltconfig.
|
||||
#
|
||||
# the following will cause an existing older ltconfig to fail, so
|
||||
# we ignore this at the expense of the cache file... Checking this
|
||||
# will just take longer ... bummer!
|
||||
#libtool_flags="--cache-file=$cache_file"
|
||||
#
|
||||
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
|
||||
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
|
||||
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
|
||||
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
|
||||
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
|
||||
ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
|
||||
[libtool_flags="$libtool_flags --enable-dlopen"])
|
||||
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
|
||||
[libtool_flags="$libtool_flags --enable-win32-dll"])
|
||||
AC_ARG_ENABLE(libtool-lock,
|
||||
[ --disable-libtool-lock avoid locking (might break parallel builds)])
|
||||
test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
|
||||
test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
|
||||
|
||||
# Some flags need to be propagated to the compiler or linker for good
|
||||
# libtool support.
|
||||
case "$lt_target" in
|
||||
*-*-irix6*)
|
||||
# Find out which ABI we are using.
|
||||
echo '[#]line __oline__ "configure"' > conftest.$ac_ext
|
||||
if AC_TRY_EVAL(ac_compile); then
|
||||
case "`/usr/bin/file conftest.o`" in
|
||||
*32-bit*)
|
||||
LD="${LD-ld} -32"
|
||||
;;
|
||||
*N32*)
|
||||
LD="${LD-ld} -n32"
|
||||
;;
|
||||
*64-bit*)
|
||||
LD="${LD-ld} -64"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
rm -rf conftest*
|
||||
;;
|
||||
|
||||
*-*-sco3.2v5*)
|
||||
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
|
||||
SAVE_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -belf"
|
||||
AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
|
||||
[AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
|
||||
if test x"$lt_cv_cc_needs_belf" != x"yes"; then
|
||||
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
|
||||
CFLAGS="$SAVE_CFLAGS"
|
||||
fi
|
||||
;;
|
||||
|
||||
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
|
||||
[*-*-cygwin* | *-*-mingw*)
|
||||
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
|
||||
AC_CHECK_TOOL(AS, as, false)
|
||||
AC_CHECK_TOOL(OBJDUMP, objdump, false)
|
||||
;;
|
||||
])
|
||||
esac
|
||||
])
|
||||
|
||||
# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
|
||||
AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
|
||||
|
||||
# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
|
||||
AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
|
||||
|
||||
# AC_ENABLE_SHARED - implement the --enable-shared flag
|
||||
# Usage: AC_ENABLE_SHARED[(DEFAULT)]
|
||||
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
||||
# `yes'.
|
||||
AC_DEFUN(AC_ENABLE_SHARED, [dnl
|
||||
define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
|
||||
AC_ARG_ENABLE(shared,
|
||||
changequote(<<, >>)dnl
|
||||
<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
|
||||
changequote([, ])dnl
|
||||
[p=${PACKAGE-default}
|
||||
case "$enableval" in
|
||||
yes) enable_shared=yes ;;
|
||||
no) enable_shared=no ;;
|
||||
*)
|
||||
enable_shared=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
|
||||
for pkg in $enableval; do
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_shared=yes
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
|
||||
])
|
||||
|
||||
# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
|
||||
AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
AC_ENABLE_SHARED(no)])
|
||||
|
||||
# AC_ENABLE_STATIC - implement the --enable-static flag
|
||||
# Usage: AC_ENABLE_STATIC[(DEFAULT)]
|
||||
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
||||
# `yes'.
|
||||
AC_DEFUN(AC_ENABLE_STATIC, [dnl
|
||||
define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
|
||||
AC_ARG_ENABLE(static,
|
||||
changequote(<<, >>)dnl
|
||||
<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
|
||||
changequote([, ])dnl
|
||||
[p=${PACKAGE-default}
|
||||
case "$enableval" in
|
||||
yes) enable_static=yes ;;
|
||||
no) enable_static=no ;;
|
||||
*)
|
||||
enable_static=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
|
||||
for pkg in $enableval; do
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_static=yes
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
|
||||
])
|
||||
|
||||
# AC_DISABLE_STATIC - set the default static flag to --disable-static
|
||||
AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
AC_ENABLE_STATIC(no)])
|
||||
|
||||
|
||||
# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
|
||||
# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
|
||||
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
||||
# `yes'.
|
||||
AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
|
||||
define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
|
||||
AC_ARG_ENABLE(fast-install,
|
||||
changequote(<<, >>)dnl
|
||||
<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
|
||||
changequote([, ])dnl
|
||||
[p=${PACKAGE-default}
|
||||
case "$enableval" in
|
||||
yes) enable_fast_install=yes ;;
|
||||
no) enable_fast_install=no ;;
|
||||
*)
|
||||
enable_fast_install=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
|
||||
for pkg in $enableval; do
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_fast_install=yes
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
|
||||
])
|
||||
|
||||
# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
|
||||
AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
AC_ENABLE_FAST_INSTALL(no)])
|
||||
|
||||
# AC_PROG_LD - find the path to the GNU or non-GNU linker
|
||||
AC_DEFUN(AC_PROG_LD,
|
||||
[AC_ARG_WITH(gnu-ld,
|
||||
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
|
||||
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
|
||||
AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
|
||||
ac_prog=ld
|
||||
if test "$ac_cv_prog_gcc" = yes; then
|
||||
# Check if gcc -print-prog-name=ld gives a path.
|
||||
AC_MSG_CHECKING([for ld used by GCC])
|
||||
ac_prog=`($CC -print-prog-name=ld) 2>&5`
|
||||
case "$ac_prog" in
|
||||
# Accept absolute paths.
|
||||
changequote(,)dnl
|
||||
[\\/]* | [A-Za-z]:[\\/]*)
|
||||
re_direlt='/[^/][^/]*/\.\./'
|
||||
changequote([,])dnl
|
||||
# Canonicalize the path of ld
|
||||
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
|
||||
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
|
||||
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
|
||||
done
|
||||
test -z "$LD" && LD="$ac_prog"
|
||||
;;
|
||||
"")
|
||||
# If it fails, then pretend we aren't using GCC.
|
||||
ac_prog=ld
|
||||
;;
|
||||
*)
|
||||
# If it is relative, then search for the first ld in PATH.
|
||||
with_gnu_ld=unknown
|
||||
;;
|
||||
esac
|
||||
elif test "$with_gnu_ld" = yes; then
|
||||
AC_MSG_CHECKING([for GNU ld])
|
||||
else
|
||||
AC_MSG_CHECKING([for non-GNU ld])
|
||||
fi
|
||||
AC_CACHE_VAL(ac_cv_path_LD,
|
||||
[if test -z "$LD"; then
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
|
||||
for ac_dir in $PATH; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
|
||||
ac_cv_path_LD="$ac_dir/$ac_prog"
|
||||
# Check to see if the program is GNU ld. I'd rather use --version,
|
||||
# but apparently some GNU ld's only accept -v.
|
||||
# Break only if it was the GNU/non-GNU ld that we prefer.
|
||||
if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
|
||||
test "$with_gnu_ld" != no && break
|
||||
else
|
||||
test "$with_gnu_ld" != yes && break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
else
|
||||
ac_cv_path_LD="$LD" # Let the user override the test with a path.
|
||||
fi])
|
||||
LD="$ac_cv_path_LD"
|
||||
if test -n "$LD"; then
|
||||
AC_MSG_RESULT($LD)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
|
||||
AC_PROG_LD_GNU
|
||||
])
|
||||
|
||||
AC_DEFUN(AC_PROG_LD_GNU,
|
||||
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
|
||||
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
|
||||
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
|
||||
ac_cv_prog_gnu_ld=yes
|
||||
else
|
||||
ac_cv_prog_gnu_ld=no
|
||||
fi])
|
||||
])
|
||||
|
||||
# AC_PROG_NM - find the path to a BSD-compatible name lister
|
||||
AC_DEFUN(AC_PROG_NM,
|
||||
[AC_MSG_CHECKING([for BSD-compatible nm])
|
||||
AC_CACHE_VAL(ac_cv_path_NM,
|
||||
[if test -n "$NM"; then
|
||||
# Let the user override the test.
|
||||
ac_cv_path_NM="$NM"
|
||||
else
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
|
||||
for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
|
||||
# Check to see if the nm accepts a BSD-compat flag.
|
||||
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
|
||||
# nm: unknown option "B" ignored
|
||||
if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
|
||||
ac_cv_path_NM="$ac_dir/nm -B"
|
||||
break
|
||||
elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
|
||||
ac_cv_path_NM="$ac_dir/nm -p"
|
||||
break
|
||||
else
|
||||
ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
|
||||
continue # so that we can try to find one that supports BSD flags
|
||||
fi
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
|
||||
fi])
|
||||
NM="$ac_cv_path_NM"
|
||||
AC_MSG_RESULT([$NM])
|
||||
])
|
||||
|
||||
# AC_CHECK_LIBM - check for math library
|
||||
AC_DEFUN(AC_CHECK_LIBM,
|
||||
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
LIBM=
|
||||
case "$lt_target" in
|
||||
*-*-beos* | *-*-cygwin*)
|
||||
# These system don't have libm
|
||||
;;
|
||||
*-ncr-sysv4.3*)
|
||||
AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
|
||||
AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
|
||||
;;
|
||||
*)
|
||||
AC_CHECK_LIB(m, main, LIBM="-lm")
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
|
||||
# the libltdl convenience library and INCLTDL to the include flags for
|
||||
# the libltdl header and adds --enable-ltdl-convenience to the
|
||||
# configure arguments. Note that LIBLTDL and INCLTDL are not
|
||||
# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
|
||||
# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
|
||||
# with '${top_builddir}/' and INCLTDL will be prefixed with
|
||||
# '${top_srcdir}/' (note the single quotes!). If your package is not
|
||||
# flat and you're not using automake, define top_builddir and
|
||||
# top_srcdir appropriately in the Makefiles.
|
||||
AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
case "$enable_ltdl_convenience" in
|
||||
no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
|
||||
"") enable_ltdl_convenience=yes
|
||||
ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
|
||||
esac
|
||||
LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
|
||||
INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
|
||||
])
|
||||
|
||||
# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
|
||||
# the libltdl installable library and INCLTDL to the include flags for
|
||||
# the libltdl header and adds --enable-ltdl-install to the configure
|
||||
# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
|
||||
# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
|
||||
# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
|
||||
# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
|
||||
# with '${top_srcdir}/' (note the single quotes!). If your package is
|
||||
# not flat and you're not using automake, define top_builddir and
|
||||
# top_srcdir appropriately in the Makefiles.
|
||||
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
|
||||
AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
AC_CHECK_LIB(ltdl, main,
|
||||
[test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
|
||||
[if test x"$enable_ltdl_install" = xno; then
|
||||
AC_MSG_WARN([libltdl not installed, but installation disabled])
|
||||
else
|
||||
enable_ltdl_install=yes
|
||||
fi
|
||||
])
|
||||
if test x"$enable_ltdl_install" = x"yes"; then
|
||||
ac_configure_args="$ac_configure_args --enable-ltdl-install"
|
||||
LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
|
||||
INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
|
||||
else
|
||||
ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
|
||||
LIBLTDL="-lltdl"
|
||||
INCLTDL=
|
||||
fi
|
||||
])
|
||||
|
||||
dnl old names
|
||||
AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
|
||||
AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
|
||||
AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
|
||||
AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
|
||||
AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
|
||||
AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
|
||||
AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
|
||||
|
||||
dnl This is just to silence aclocal about the macro not being used
|
||||
ifelse([AC_DISABLE_FAST_INSTALL])dnl
|
||||
|
1
libstdc++-v3/libsupc++/config.h.in
Normal file
1
libstdc++-v3/libsupc++/config.h.in
Normal file
@ -0,0 +1 @@
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
1538
libstdc++-v3/libsupc++/configure
vendored
Executable file
1538
libstdc++-v3/libsupc++/configure
vendored
Executable file
File diff suppressed because it is too large
Load Diff
16
libstdc++-v3/libsupc++/configure.in
Normal file
16
libstdc++-v3/libsupc++/configure.in
Normal file
@ -0,0 +1,16 @@
|
||||
# Process this file with autoconf to produce a configure script, like so:
|
||||
# aclocal, autoconf, autoheader, automake
|
||||
|
||||
AC_PREREQ(2.13)
|
||||
AC_INIT(new_handler.cc)
|
||||
AC_CONFIG_AUX_DIR(..)
|
||||
|
||||
PACKAGE=libsupc++
|
||||
VERSION=3.0
|
||||
AC_SUBST(PACKAGE)
|
||||
AC_SUBST(VERSION)
|
||||
|
||||
AC_CANONICAL_SYSTEM
|
||||
AM_PROG_LIBTOOL
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_CXX
|
39
libstdc++-v3/libsupc++/del_op.cc
Normal file
39
libstdc++-v3/libsupc++/del_op.cc
Normal file
@ -0,0 +1,39 @@
|
||||
// Boilerplate support routines for -*- C++ -*- dynamic memory management.
|
||||
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
|
||||
//
|
||||
// This file is part of GNU CC.
|
||||
//
|
||||
// GNU CC 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.
|
||||
//
|
||||
// GNU CC 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 GNU CC; 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.
|
||||
|
||||
#include "new"
|
||||
|
||||
extern "C" void free (void *);
|
||||
|
||||
void
|
||||
operator delete (void *ptr) throw ()
|
||||
{
|
||||
if (ptr)
|
||||
free (ptr);
|
||||
}
|
39
libstdc++-v3/libsupc++/del_opnt.cc
Normal file
39
libstdc++-v3/libsupc++/del_opnt.cc
Normal file
@ -0,0 +1,39 @@
|
||||
// Boilerplate support routines for -*- C++ -*- dynamic memory management.
|
||||
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
|
||||
//
|
||||
// This file is part of GNU CC.
|
||||
//
|
||||
// GNU CC 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.
|
||||
//
|
||||
// GNU CC 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 GNU CC; 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.
|
||||
|
||||
#include "new"
|
||||
|
||||
extern "C" void free (void *);
|
||||
|
||||
void
|
||||
operator delete (void *ptr, const std::nothrow_t&) throw ()
|
||||
{
|
||||
if (ptr)
|
||||
free (ptr);
|
||||
}
|
36
libstdc++-v3/libsupc++/del_opv.cc
Normal file
36
libstdc++-v3/libsupc++/del_opv.cc
Normal file
@ -0,0 +1,36 @@
|
||||
// Boilerplate support routines for -*- C++ -*- dynamic memory management.
|
||||
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
|
||||
//
|
||||
// This file is part of GNU CC.
|
||||
//
|
||||
// GNU CC 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.
|
||||
//
|
||||
// GNU CC 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 GNU CC; 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.
|
||||
|
||||
#include "new"
|
||||
|
||||
void
|
||||
operator delete[] (void *ptr) throw ()
|
||||
{
|
||||
::operator delete (ptr);
|
||||
}
|
36
libstdc++-v3/libsupc++/del_opvnt.cc
Normal file
36
libstdc++-v3/libsupc++/del_opvnt.cc
Normal file
@ -0,0 +1,36 @@
|
||||
// Boilerplate support routines for -*- C++ -*- dynamic memory management.
|
||||
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
|
||||
//
|
||||
// This file is part of GNU CC.
|
||||
//
|
||||
// GNU CC 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.
|
||||
//
|
||||
// GNU CC 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 GNU CC; 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.
|
||||
|
||||
#include "new"
|
||||
|
||||
void
|
||||
operator delete[] (void *ptr, const std::nothrow_t&) throw ()
|
||||
{
|
||||
::operator delete (ptr);
|
||||
}
|
403
libstdc++-v3/libsupc++/exception.cc
Normal file
403
libstdc++-v3/libsupc++/exception.cc
Normal file
@ -0,0 +1,403 @@
|
||||
// Functions for Exception Support for -*- C++ -*-
|
||||
// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation
|
||||
|
||||
// This file is part of GNU CC.
|
||||
|
||||
// GNU CC 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.
|
||||
|
||||
// GNU CC 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 GNU CC; 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.
|
||||
|
||||
#pragma implementation "exception"
|
||||
|
||||
#include "typeinfo"
|
||||
#include "exception"
|
||||
#include <stddef.h>
|
||||
#include "gansidecl.h" /* Needed to support macros used in eh-common.h. */
|
||||
#include "eh-common.h"
|
||||
|
||||
/* Define terminate, unexpected, set_terminate, set_unexpected as
|
||||
well as the default terminate func and default unexpected func. */
|
||||
|
||||
extern std::terminate_handler __terminate_func __attribute__((__noreturn__));
|
||||
using std::terminate;
|
||||
|
||||
void
|
||||
std::terminate ()
|
||||
{
|
||||
__terminate_func ();
|
||||
}
|
||||
|
||||
void
|
||||
__default_unexpected ()
|
||||
{
|
||||
terminate ();
|
||||
}
|
||||
|
||||
static std::unexpected_handler __unexpected_func __attribute__((__noreturn__))
|
||||
= __default_unexpected;
|
||||
|
||||
std::terminate_handler
|
||||
std::set_terminate (std::terminate_handler func)
|
||||
{
|
||||
std::terminate_handler old = __terminate_func;
|
||||
|
||||
__terminate_func = func;
|
||||
return old;
|
||||
}
|
||||
|
||||
std::unexpected_handler
|
||||
std::set_unexpected (std::unexpected_handler func)
|
||||
{
|
||||
std::unexpected_handler old = __unexpected_func;
|
||||
|
||||
__unexpected_func = func;
|
||||
return old;
|
||||
}
|
||||
|
||||
void
|
||||
std::unexpected ()
|
||||
{
|
||||
__unexpected_func ();
|
||||
}
|
||||
|
||||
/* The type of a function called to clean up an exception object.
|
||||
(These will be destructors.) Under the old ABI, these take a
|
||||
second argument (the `in-charge' argument), that indicates whether
|
||||
or not do delete the object, and whether or not to destroy virtual
|
||||
bases. Under the new ABI, there is no second argument. */
|
||||
#if !defined (__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
|
||||
typedef void (*cleanup_fn)(void *, int);
|
||||
/* The `2' is the value for the in-charge parameter that indicates
|
||||
that virtual bases should be destroyed. */
|
||||
#define CALL_CLEANUP(FN, THIS) FN (THIS, 2)
|
||||
#else
|
||||
typedef void (*cleanup_fn)(void *);
|
||||
#define CALL_CLEANUP(FN, THIS) FN (THIS)
|
||||
#endif
|
||||
|
||||
/* C++-specific state about the current exception.
|
||||
This must match init_exception_processing().
|
||||
|
||||
Note that handlers and caught are not redundant; when rethrown, an
|
||||
exception can have multiple active handlers and still be considered
|
||||
uncaught. */
|
||||
|
||||
struct cp_eh_info
|
||||
{
|
||||
__eh_info eh_info;
|
||||
void *value;
|
||||
void *type;
|
||||
cleanup_fn cleanup;
|
||||
bool caught;
|
||||
cp_eh_info *next;
|
||||
long handlers;
|
||||
void *original_value;
|
||||
};
|
||||
|
||||
/* Language-specific EH info pointer, defined in libgcc2. */
|
||||
|
||||
extern "C" cp_eh_info **__get_eh_info (); // actually void **
|
||||
|
||||
/* Exception allocate and free, defined in libgcc2. */
|
||||
extern "C" void *__eh_alloc(size_t);
|
||||
extern "C" void __eh_free(void *);
|
||||
|
||||
/* Is P the type_info node for a pointer of some kind? */
|
||||
|
||||
extern bool __is_pointer (void *);
|
||||
|
||||
|
||||
/* OLD Compiler hook to return a pointer to the info for the current exception.
|
||||
Used by get_eh_info (). This fudges the actualy returned value to
|
||||
point to the beginning of what USE to be the cp_eh_info structure.
|
||||
THis is so that old code that dereferences this pointer will find
|
||||
things where it expects it to be.*/
|
||||
extern "C" void *
|
||||
__cp_exception_info (void)
|
||||
{
|
||||
return &((*__get_eh_info ())->value);
|
||||
}
|
||||
|
||||
#define CP_EH_INFO ((cp_eh_info *) *__get_eh_info ())
|
||||
|
||||
/* Old Compiler hook to return a pointer to the info for the current exception.
|
||||
Used by get_eh_info (). */
|
||||
|
||||
extern "C" cp_eh_info *
|
||||
__cp_eh_info (void)
|
||||
{
|
||||
cp_eh_info *p = CP_EH_INFO;
|
||||
return p;
|
||||
}
|
||||
|
||||
/* Compiler hook to return a pointer to the info for the current exception,
|
||||
Set the caught bit, and increment the number of handlers that are
|
||||
looking at this exception. This makes handlers smaller. */
|
||||
|
||||
extern "C" cp_eh_info *
|
||||
__start_cp_handler (void)
|
||||
{
|
||||
cp_eh_info *p = CP_EH_INFO;
|
||||
p->caught = 1;
|
||||
p->handlers++;
|
||||
return p;
|
||||
}
|
||||
|
||||
extern "C" int __throw_type_match_rtti_2 (const void *, const void *,
|
||||
void *, void **);
|
||||
|
||||
extern "C" void *
|
||||
__cplus_type_matcher (__eh_info *info_, void *match_info,
|
||||
exception_descriptor *exception_table)
|
||||
{
|
||||
cp_eh_info *info = (cp_eh_info *)info_;
|
||||
|
||||
/* No exception table implies the old style mechanism, so don't check. */
|
||||
if (exception_table != NULL
|
||||
&& exception_table->lang.language != EH_LANG_C_plus_plus)
|
||||
return NULL;
|
||||
|
||||
if (match_info == CATCH_ALL_TYPE)
|
||||
return (void *)1;
|
||||
|
||||
/* we don't worry about version info yet, there is only one version! */
|
||||
|
||||
void *match_type = match_info;
|
||||
|
||||
#if !defined (__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
|
||||
match_type = ((void *(*)())match_type) ();
|
||||
#endif
|
||||
|
||||
if (__throw_type_match_rtti_2 (match_type, info->type,
|
||||
info->original_value, &info->value))
|
||||
// Arbitrary non-null pointer.
|
||||
return (void *)1;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Compiler hook to push a new exception onto the stack.
|
||||
Used by expand_throw(). */
|
||||
|
||||
extern "C" void
|
||||
__cp_push_exception (void *value, void *type, cleanup_fn cleanup)
|
||||
{
|
||||
cp_eh_info *p = (cp_eh_info *) __eh_alloc (sizeof (cp_eh_info));
|
||||
|
||||
p->value = value;
|
||||
p->type = type;
|
||||
p->cleanup = cleanup;
|
||||
p->handlers = 0;
|
||||
p->caught = false;
|
||||
p->original_value = value;
|
||||
|
||||
p->eh_info.match_function = __cplus_type_matcher;
|
||||
p->eh_info.language = EH_LANG_C_plus_plus;
|
||||
p->eh_info.version = 1;
|
||||
|
||||
cp_eh_info **q = __get_eh_info ();
|
||||
|
||||
p->next = *q;
|
||||
*q = p;
|
||||
}
|
||||
|
||||
/* Compiler hook to pop an exception that has been finalized. Used by
|
||||
push_eh_cleanup(). P is the info for the exception caught by the
|
||||
current catch block. */
|
||||
|
||||
extern "C" void
|
||||
__cp_pop_exception (cp_eh_info *p)
|
||||
{
|
||||
cp_eh_info **stack = __get_eh_info ();
|
||||
cp_eh_info **q = stack;
|
||||
|
||||
--p->handlers;
|
||||
|
||||
/* Do nothing if our exception is being rethrown (i.e. if the active
|
||||
exception is our exception and it is uncaught). */
|
||||
if (p == *q && !p->caught)
|
||||
return;
|
||||
|
||||
/* Don't really pop if there are still active handlers for our exception;
|
||||
rather, push it down past any uncaught exceptions. */
|
||||
if (p->handlers != 0)
|
||||
{
|
||||
if (p == *q && p->next && !p->next->caught)
|
||||
{
|
||||
q = &(p->next);
|
||||
while (1)
|
||||
{
|
||||
if (*q == 0 || (*q)->caught)
|
||||
break;
|
||||
|
||||
q = &((*q)->next);
|
||||
}
|
||||
*stack = p->next;
|
||||
p->next = *q;
|
||||
*q = p;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
for (; *q; q = &((*q)->next))
|
||||
if (*q == p)
|
||||
break;
|
||||
|
||||
if (! *q)
|
||||
terminate ();
|
||||
|
||||
*q = p->next;
|
||||
|
||||
if (p->cleanup)
|
||||
// value may have been adjusted.
|
||||
CALL_CLEANUP (p->cleanup, p->original_value);
|
||||
|
||||
if (! __is_pointer (p->type))
|
||||
__eh_free (p->original_value); // value may have been adjusted.
|
||||
|
||||
__eh_free (p);
|
||||
}
|
||||
|
||||
/* We're doing a rethrow. Find the currently handled exception, mark it
|
||||
uncaught, and move it to the top of the EH stack. */
|
||||
|
||||
extern "C" void
|
||||
__uncatch_exception (void)
|
||||
{
|
||||
cp_eh_info **stack = __get_eh_info ();
|
||||
cp_eh_info **q = stack;
|
||||
cp_eh_info *p;
|
||||
|
||||
while (1)
|
||||
{
|
||||
p = *q;
|
||||
|
||||
if (p == 0)
|
||||
terminate ();
|
||||
if (p->caught)
|
||||
break;
|
||||
|
||||
q = &(p->next);
|
||||
}
|
||||
|
||||
if (q != stack)
|
||||
{
|
||||
*q = p->next;
|
||||
p->next = *stack;
|
||||
*stack = p;
|
||||
}
|
||||
|
||||
p->caught = false;
|
||||
}
|
||||
|
||||
/* As per [except.unexpected]:
|
||||
If an exception is thrown, we check it against the spec. If it doesn't
|
||||
match, we call unexpected (). If unexpected () throws, we check that
|
||||
exception against the spec. If it doesn't match, if the spec allows
|
||||
bad_exception we throw that; otherwise we call terminate ().
|
||||
|
||||
The compiler treats an exception spec as a try block with a generic
|
||||
handler that just calls this function with a list of the allowed
|
||||
exception types, so we have an active exception that can be rethrown.
|
||||
|
||||
This function does not return. */
|
||||
|
||||
extern "C" void
|
||||
__check_eh_spec (int n, const void **spec)
|
||||
{
|
||||
cp_eh_info *p = CP_EH_INFO;
|
||||
void *d;
|
||||
|
||||
for (int i = 0; i < n; ++i)
|
||||
{
|
||||
if (__throw_type_match_rtti_2 (spec[i], p->type, p->value, &d))
|
||||
throw;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
std::unexpected ();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
// __exception_info is an artificial var pushed into each catch block.
|
||||
if (p != __exception_info)
|
||||
{
|
||||
p = __exception_info;
|
||||
for (int i = 0; i < n; ++i)
|
||||
{
|
||||
if (__throw_type_match_rtti_2 (spec[i], p->type, p->value, &d))
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
const std::type_info &bad_exc = typeid (std::bad_exception);
|
||||
for (int i = 0; i < n; ++i)
|
||||
{
|
||||
if (__throw_type_match_rtti_2 (spec[i], &bad_exc, p->value, &d))
|
||||
throw std::bad_exception ();
|
||||
}
|
||||
|
||||
terminate ();
|
||||
}
|
||||
}
|
||||
|
||||
/* Special case of the above for throw() specs. */
|
||||
|
||||
extern "C" void
|
||||
__check_null_eh_spec (void)
|
||||
{
|
||||
__check_eh_spec (0, 0);
|
||||
}
|
||||
|
||||
// Helpers for rtti. Although these don't return, we give them return types so
|
||||
// that the type system is not broken.
|
||||
|
||||
extern "C" void *
|
||||
__throw_bad_cast ()
|
||||
{
|
||||
throw std::bad_cast ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern "C" std::type_info const &
|
||||
__throw_bad_typeid ()
|
||||
{
|
||||
throw std::bad_typeid ();
|
||||
return typeid (void);
|
||||
}
|
||||
|
||||
/* Has the current exception been caught? */
|
||||
|
||||
bool
|
||||
std::uncaught_exception ()
|
||||
{
|
||||
cp_eh_info *p = CP_EH_INFO;
|
||||
return p && ! p->caught;
|
||||
}
|
||||
|
||||
const char * std::exception::
|
||||
what () const
|
||||
{
|
||||
return typeid (*this).name ();
|
||||
}
|
44
libstdc++-v3/libsupc++/new_handler.cc
Normal file
44
libstdc++-v3/libsupc++/new_handler.cc
Normal file
@ -0,0 +1,44 @@
|
||||
// Implementation file for the -*- C++ -*- dynamic memory management header.
|
||||
// Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation
|
||||
//
|
||||
// This file is part of GNU CC.
|
||||
//
|
||||
// GNU CC 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.
|
||||
//
|
||||
// GNU CC 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 GNU CC; 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.
|
||||
|
||||
#pragma implementation "new"
|
||||
#include "new"
|
||||
|
||||
const std::nothrow_t std::nothrow = { };
|
||||
|
||||
using std::new_handler;
|
||||
new_handler __new_handler;
|
||||
|
||||
new_handler
|
||||
std::set_new_handler (new_handler handler)
|
||||
{
|
||||
new_handler prev_handler = __new_handler;
|
||||
__new_handler = handler;
|
||||
return prev_handler;
|
||||
}
|
56
libstdc++-v3/libsupc++/new_op.cc
Normal file
56
libstdc++-v3/libsupc++/new_op.cc
Normal file
@ -0,0 +1,56 @@
|
||||
// Support routines for the -*- C++ -*- dynamic memory management.
|
||||
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
|
||||
//
|
||||
// This file is part of GNU CC.
|
||||
//
|
||||
// GNU CC 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.
|
||||
//
|
||||
// GNU CC 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 GNU CC; 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.
|
||||
|
||||
#include "new"
|
||||
using std::new_handler;
|
||||
using std::bad_alloc;
|
||||
|
||||
extern "C" void *malloc (size_t);
|
||||
extern new_handler __new_handler;
|
||||
|
||||
void *
|
||||
operator new (size_t sz) throw (std::bad_alloc)
|
||||
{
|
||||
void *p;
|
||||
|
||||
/* malloc (0) is unpredictable; avoid it. */
|
||||
if (sz == 0)
|
||||
sz = 1;
|
||||
p = (void *) malloc (sz);
|
||||
while (p == 0)
|
||||
{
|
||||
new_handler handler = __new_handler;
|
||||
if (! handler)
|
||||
throw bad_alloc ();
|
||||
handler ();
|
||||
p = (void *) malloc (sz);
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
64
libstdc++-v3/libsupc++/new_opnt.cc
Normal file
64
libstdc++-v3/libsupc++/new_opnt.cc
Normal file
@ -0,0 +1,64 @@
|
||||
// Support routines for the -*- C++ -*- dynamic memory management.
|
||||
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
|
||||
//
|
||||
// This file is part of GNU CC.
|
||||
//
|
||||
// GNU CC 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.
|
||||
//
|
||||
// GNU CC 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 GNU CC; 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.
|
||||
|
||||
#include "new"
|
||||
using std::new_handler;
|
||||
using std::bad_alloc;
|
||||
|
||||
extern "C" void *malloc (size_t);
|
||||
extern new_handler __new_handler;
|
||||
|
||||
void *
|
||||
operator new (size_t sz, const std::nothrow_t&) throw()
|
||||
{
|
||||
void *p;
|
||||
|
||||
/* malloc (0) is unpredictable; avoid it. */
|
||||
if (sz == 0)
|
||||
sz = 1;
|
||||
p = (void *) malloc (sz);
|
||||
while (p == 0)
|
||||
{
|
||||
new_handler handler = __new_handler;
|
||||
if (! handler)
|
||||
return 0;
|
||||
try
|
||||
{
|
||||
handler ();
|
||||
}
|
||||
catch (bad_alloc &)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
p = (void *) malloc (sz);
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
36
libstdc++-v3/libsupc++/new_opv.cc
Normal file
36
libstdc++-v3/libsupc++/new_opv.cc
Normal file
@ -0,0 +1,36 @@
|
||||
// Boilerplate support routines for -*- C++ -*- dynamic memory management.
|
||||
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
|
||||
//
|
||||
// This file is part of GNU CC.
|
||||
//
|
||||
// GNU CC 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.
|
||||
//
|
||||
// GNU CC 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 GNU CC; 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.
|
||||
|
||||
#include "new"
|
||||
|
||||
void *
|
||||
operator new[] (size_t sz) throw (std::bad_alloc)
|
||||
{
|
||||
return ::operator new(sz);
|
||||
}
|
36
libstdc++-v3/libsupc++/new_opvnt.cc
Normal file
36
libstdc++-v3/libsupc++/new_opvnt.cc
Normal file
@ -0,0 +1,36 @@
|
||||
// Boilerplate support routines for -*- C++ -*- dynamic memory management.
|
||||
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
|
||||
//
|
||||
// This file is part of GNU CC.
|
||||
//
|
||||
// GNU CC 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.
|
||||
//
|
||||
// GNU CC 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 GNU CC; 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.
|
||||
|
||||
#include "new"
|
||||
|
||||
void *
|
||||
operator new[] (size_t sz, const std::nothrow_t& nothrow) throw()
|
||||
{
|
||||
return ::operator new(sz, nothrow);
|
||||
}
|
1210
libstdc++-v3/libsupc++/tinfo.cc
Normal file
1210
libstdc++-v3/libsupc++/tinfo.cc
Normal file
File diff suppressed because it is too large
Load Diff
223
libstdc++-v3/libsupc++/tinfo.h
Normal file
223
libstdc++-v3/libsupc++/tinfo.h
Normal file
@ -0,0 +1,223 @@
|
||||
// RTTI support internals for -*- C++ -*-
|
||||
// Copyright (C) 1994, 1995, 1996, 1998, 1999, 2000 Free Software Foundation
|
||||
|
||||
#include "typeinfo"
|
||||
|
||||
// Class declarations shared between the typeinfo implementation files.
|
||||
|
||||
#if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
|
||||
// original (old) abi
|
||||
|
||||
// type_info for a class with no base classes (or an enum).
|
||||
|
||||
struct __user_type_info : public std::type_info {
|
||||
__user_type_info (const char *n) : type_info (n) {}
|
||||
|
||||
// If our type can be upcast to a public and unambiguous base, then return
|
||||
// non-zero and set RES to point to the base object. OBJ points to the throw
|
||||
// object and can be NULL, if there is no object to adjust.
|
||||
int upcast (const type_info &target, void *obj, void **res) const;
|
||||
|
||||
// If our type can be dynamicly cast to the target type, then return
|
||||
// pointer to the target object. OBJ is the pointer to the most derived
|
||||
// type and cannot be NULL. SUBTYPE and SUBOBJ indicate the static type
|
||||
// base object from whence we came, it cannot be NULL. SUBTYPE cannot be
|
||||
// the same as TARGET. TARGET cannot be a base of SUBTYPE.
|
||||
// BOFF indicates how SUBTYPE is related to TARGET.
|
||||
// BOFF >= 0, there is only one public non-virtual SUBTYPE base at offset
|
||||
// BOFF, and there are no public virtual SUBTYPE bases.
|
||||
// Therefore check if SUBOBJ is at offset BOFF when we find a target
|
||||
// BOFF == -1, SUBTYPE occurs as multiple public virtual or non-virtual bases.
|
||||
// Lazily search all the bases of TARGET.
|
||||
// BOFF == -2, SUBTYPE is not a public base.
|
||||
// BOFF == -3, SUBTYPE occurs as multiple public non-virtual bases.
|
||||
// Lazily search the non-virtual bases of TARGET.
|
||||
// For backwards compatibility set BOFF to -1, that is the safe "unknown"
|
||||
// value. We do not care about SUBTYPES as private bases of TARGET, as they
|
||||
// can never succeed as downcasts, only as crosscasts -- and then only if
|
||||
// they are virtual. This is more complicated that it might seem.
|
||||
void *dyncast (int boff,
|
||||
const type_info &target, void *obj,
|
||||
const type_info &subtype, void *subobj) const;
|
||||
|
||||
// non_virtual_base_type is used to indicate that a base class is via a
|
||||
// non-virtual access path.
|
||||
static const type_info *const nonvirtual_base_type
|
||||
= static_cast <const type_info *> (0) + 1;
|
||||
|
||||
// sub_kind tells us about how a base object is contained within a derived
|
||||
// object. We often do this lazily, hence the UNKNOWN value. At other times
|
||||
// we may use NOT_CONTAINED to mean not publicly contained.
|
||||
enum sub_kind
|
||||
{
|
||||
unknown = 0, // we have no idea
|
||||
not_contained, // not contained within us (in some
|
||||
// circumstances this might mean not contained
|
||||
// publicly)
|
||||
contained_ambig, // contained ambiguously
|
||||
contained_mask = 4, // contained within us
|
||||
contained_virtual_mask = 1, // via a virtual path
|
||||
contained_public_mask = 2, // via a public path
|
||||
contained_private = contained_mask,
|
||||
contained_public = contained_mask | contained_public_mask
|
||||
};
|
||||
// some predicate functions for sub_kind
|
||||
static inline bool contained_p (sub_kind access_path)
|
||||
{
|
||||
return access_path >= contained_mask;
|
||||
}
|
||||
static inline bool contained_public_p (sub_kind access_path)
|
||||
{
|
||||
return access_path >= contained_public;
|
||||
}
|
||||
static inline bool contained_nonpublic_p (sub_kind access_path)
|
||||
{
|
||||
return (access_path & contained_public) == contained_mask;
|
||||
}
|
||||
static inline bool contained_nonvirtual_p (sub_kind access_path)
|
||||
{
|
||||
return (access_path & (contained_mask | contained_virtual_mask))
|
||||
== contained_mask;
|
||||
}
|
||||
static inline bool contained_virtual_p (sub_kind access_path)
|
||||
{
|
||||
return (access_path & (contained_mask | contained_virtual_mask))
|
||||
== (contained_mask | contained_virtual_mask);
|
||||
}
|
||||
|
||||
struct upcast_result
|
||||
{
|
||||
void *target_obj; // pointer to target object or NULL (init NULL)
|
||||
sub_kind whole2target; // path from most derived object to target
|
||||
const type_info *base_type; // where we found the target, (init NULL)
|
||||
// if in vbase the __user_type_info of vbase)
|
||||
// if a non-virtual base then 1
|
||||
// else NULL
|
||||
public:
|
||||
upcast_result ()
|
||||
:target_obj (NULL), whole2target (unknown), base_type (NULL)
|
||||
{}
|
||||
};
|
||||
struct dyncast_result
|
||||
{
|
||||
void *target_obj; // pointer to target object or NULL (init NULL)
|
||||
sub_kind whole2target; // path from most derived object to target
|
||||
sub_kind whole2sub; // path from most derived object to sub object
|
||||
sub_kind target2sub; // path from target to sub object
|
||||
|
||||
public:
|
||||
dyncast_result ()
|
||||
:target_obj (NULL), whole2target (unknown),
|
||||
whole2sub (unknown), target2sub (unknown)
|
||||
{}
|
||||
};
|
||||
|
||||
public:
|
||||
// Helper for upcast. See if TARGET is us, or one of our bases. ACCESS_PATH
|
||||
// gives the access from the start object. Return TRUE if we know the catch
|
||||
// fails.
|
||||
virtual bool do_upcast (sub_kind access_path,
|
||||
const type_info &target, void *obj,
|
||||
upcast_result &__restrict result) const;
|
||||
// Helper for dyncast. BOFF indicates how the SUBTYPE is related to TARGET.
|
||||
// ACCESS_PATH indicates the access from the most derived object. It is
|
||||
// used to prune the DAG walk. All information about what we find is put
|
||||
// into RESULT. Return true, if the match we have found is ambiguous.
|
||||
virtual bool do_dyncast (int boff, sub_kind access_path,
|
||||
const type_info &target, void *obj,
|
||||
const type_info &subtype, void *subptr,
|
||||
dyncast_result &__restrict result) const;
|
||||
public:
|
||||
// Indicate whether SUBPTR of type SUBTYPE is contained publicly within
|
||||
// OBJPTR. OBJPTR points to this base object. BOFF indicates how SUBTYPE
|
||||
// objects might be contained within this type. If SUBPTR is one of our
|
||||
// SUBTYPE bases, indicate virtuality. Returns not_contained for non
|
||||
// containment or private containment.
|
||||
sub_kind find_public_subobj (int boff, const type_info &subtype,
|
||||
void *objptr, void *subptr) const
|
||||
{
|
||||
if (boff >= 0)
|
||||
return ((char *)subptr - (char *)objptr) == boff
|
||||
? contained_public : not_contained;
|
||||
if (boff == -2)
|
||||
return not_contained;
|
||||
return do_find_public_subobj (boff, subtype, objptr, subptr);
|
||||
}
|
||||
|
||||
public:
|
||||
// Helper for find_subobj. BOFF indicates how SUBTYPE bases are inherited by
|
||||
// the type started from -- which is not necessarily the current type.
|
||||
// OBJPTR points to the current base.
|
||||
virtual sub_kind do_find_public_subobj (int boff, const type_info &subtype,
|
||||
void *objptr, void *subptr) const;
|
||||
};
|
||||
|
||||
// type_info for a class with one public, nonvirtual base class.
|
||||
|
||||
class __si_type_info : public __user_type_info {
|
||||
const __user_type_info &base;
|
||||
|
||||
public:
|
||||
__si_type_info (const char *n, const __user_type_info &b)
|
||||
: __user_type_info (n), base (b) { }
|
||||
|
||||
private:
|
||||
virtual bool do_upcast (sub_kind access_path,
|
||||
const type_info &target, void *obj,
|
||||
upcast_result &__restrict result) const;
|
||||
virtual bool do_dyncast (int boff, sub_kind access_path,
|
||||
const type_info &target, void *obj,
|
||||
const type_info &subtype, void *subptr,
|
||||
dyncast_result &__restrict result) const;
|
||||
virtual sub_kind do_find_public_subobj (int boff, const type_info &subtype,
|
||||
void *objptr, void *subptr) const;
|
||||
};
|
||||
|
||||
// type_info for a general class.
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#if INT_MAX == 2147483647
|
||||
typedef int myint32;
|
||||
#elif SHRT_MAX == 2147483647
|
||||
typedef short myint32;
|
||||
#elif SCHAR_MAX == 2147483647
|
||||
typedef signed char myint32;
|
||||
#elif LONG_MAX == 2147483647
|
||||
typedef long myint32;
|
||||
#else
|
||||
# error "No 32-bit data type?"
|
||||
#endif
|
||||
|
||||
struct __class_type_info : public __user_type_info {
|
||||
enum access { PUBLIC = 1, PROTECTED = 2, PRIVATE = 3 };
|
||||
|
||||
struct base_info {
|
||||
const __user_type_info *base;
|
||||
myint32 offset: 29;
|
||||
bool is_virtual: 1;
|
||||
enum access access: 2;
|
||||
};
|
||||
|
||||
const base_info *base_list;
|
||||
size_t n_bases;
|
||||
|
||||
__class_type_info (const char *name, const base_info *bl, size_t bn)
|
||||
: __user_type_info (name), base_list (bl), n_bases (bn) {}
|
||||
|
||||
public:
|
||||
virtual bool do_upcast (sub_kind access_path,
|
||||
const type_info &target, void *obj,
|
||||
upcast_result &__restrict result) const;
|
||||
virtual bool do_dyncast (int boff, sub_kind access_path,
|
||||
const type_info &target, void *obj,
|
||||
const type_info &subtype, void *subptr,
|
||||
dyncast_result &__restrict result) const;
|
||||
virtual sub_kind do_find_public_subobj (int boff, const type_info &subtype,
|
||||
void *objptr, void *subptr) const;
|
||||
};
|
||||
#else
|
||||
// new abi
|
||||
#include <cxxabi.h>
|
||||
|
||||
#endif
|
452
libstdc++-v3/libsupc++/tinfo2.cc
Normal file
452
libstdc++-v3/libsupc++/tinfo2.cc
Normal file
@ -0,0 +1,452 @@
|
||||
// Methods for type_info for -*- C++ -*- Run Time Type Identification.
|
||||
// Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000 Free Software Foundation
|
||||
|
||||
// This file is part of GNU CC.
|
||||
|
||||
// GNU CC 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.
|
||||
|
||||
// GNU CC 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 GNU CC; 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.
|
||||
|
||||
#include <stddef.h>
|
||||
#include "tinfo.h"
|
||||
#include "new" // for placement new
|
||||
|
||||
// We can't rely on having stdlib.h if we're freestanding.
|
||||
extern "C" void abort ();
|
||||
|
||||
using std::type_info;
|
||||
|
||||
#if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
|
||||
bool
|
||||
type_info::before (const type_info &arg) const
|
||||
{
|
||||
return __builtin_strcmp (name (), arg.name ()) < 0;
|
||||
}
|
||||
|
||||
// type info for pointer type.
|
||||
|
||||
struct __pointer_type_info : public type_info {
|
||||
const type_info& type;
|
||||
|
||||
__pointer_type_info (const char *n, const type_info& ti)
|
||||
: type_info (n), type (ti) {}
|
||||
};
|
||||
|
||||
// type info for attributes
|
||||
|
||||
struct __attr_type_info : public type_info {
|
||||
enum cv { NONE = 0, CONST = 1, VOLATILE = 2, CONSTVOL = 1 | 2 };
|
||||
|
||||
const type_info& type;
|
||||
cv attr;
|
||||
|
||||
__attr_type_info (const char *n, cv a, const type_info& t)
|
||||
: type_info (n), type (t), attr (a) {}
|
||||
};
|
||||
|
||||
// type_info for builtin type
|
||||
|
||||
struct __builtin_type_info : public type_info {
|
||||
__builtin_type_info (const char *n): type_info (n) {}
|
||||
};
|
||||
|
||||
// type info for function.
|
||||
|
||||
struct __func_type_info : public type_info {
|
||||
__func_type_info (const char *n) : type_info (n) {}
|
||||
};
|
||||
|
||||
// type info for pointer to member function.
|
||||
|
||||
struct __ptmf_type_info : public type_info {
|
||||
__ptmf_type_info (const char *n) : type_info (n) {}
|
||||
};
|
||||
|
||||
// type info for pointer to data member.
|
||||
|
||||
struct __ptmd_type_info : public type_info {
|
||||
__ptmd_type_info (const char *n): type_info (n) {}
|
||||
};
|
||||
|
||||
// type info for array.
|
||||
|
||||
struct __array_type_info : public type_info {
|
||||
__array_type_info (const char *n): type_info (n) {}
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
#include <cxxabi.h>
|
||||
#endif
|
||||
|
||||
#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
|
||||
namespace __cxxabiv1 {
|
||||
|
||||
using namespace std;
|
||||
|
||||
// This has special meaning to the compiler, and will cause it
|
||||
// to emit the type_info structures for the fundamental types which are
|
||||
// mandated to exist in the runtime.
|
||||
__fundamental_type_info::
|
||||
~__fundamental_type_info ()
|
||||
{}
|
||||
|
||||
__array_type_info::
|
||||
~__array_type_info ()
|
||||
{}
|
||||
|
||||
__function_type_info::
|
||||
~__function_type_info ()
|
||||
{}
|
||||
|
||||
__enum_type_info::
|
||||
~__enum_type_info ()
|
||||
{}
|
||||
|
||||
__pbase_type_info::
|
||||
~__pbase_type_info ()
|
||||
{}
|
||||
|
||||
__pointer_type_info::
|
||||
~__pointer_type_info ()
|
||||
{}
|
||||
|
||||
__pointer_to_member_type_info::
|
||||
~__pointer_to_member_type_info ()
|
||||
{}
|
||||
|
||||
bool __pointer_type_info::
|
||||
__is_pointer_p () const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool __function_type_info::
|
||||
__is_function_p () const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool __pbase_type_info::
|
||||
__do_catch (const type_info *thr_type,
|
||||
void **thr_obj,
|
||||
unsigned outer) const
|
||||
{
|
||||
if (*this == *thr_type)
|
||||
return true; // same type
|
||||
if (typeid (*this) != typeid (*thr_type))
|
||||
return false; // not both same kind of pointers
|
||||
|
||||
if (!(outer & 1))
|
||||
// We're not the same and our outer pointers are not all const qualified
|
||||
// Therefore there must at least be a qualification conversion involved
|
||||
// But for that to be valid, our outer pointers must be const qualified.
|
||||
return false;
|
||||
|
||||
const __pbase_type_info *thrown_type =
|
||||
static_cast <const __pbase_type_info *> (thr_type);
|
||||
|
||||
if (thrown_type->__qualifier_flags & ~__qualifier_flags)
|
||||
// We're less qualified.
|
||||
return false;
|
||||
|
||||
if (!(__qualifier_flags & __const_mask))
|
||||
outer &= ~1;
|
||||
|
||||
return __pointer_catch (thrown_type, thr_obj, outer);
|
||||
}
|
||||
|
||||
inline bool __pbase_type_info::
|
||||
__pointer_catch (const __pbase_type_info *thrown_type,
|
||||
void **thr_obj,
|
||||
unsigned outer) const
|
||||
{
|
||||
return __pointee->__do_catch (thrown_type->__pointee, thr_obj, outer + 2);
|
||||
}
|
||||
|
||||
bool __pointer_type_info::
|
||||
__pointer_catch (const __pbase_type_info *thrown_type,
|
||||
void **thr_obj,
|
||||
unsigned outer) const
|
||||
{
|
||||
if (outer < 2 && *__pointee == typeid (void))
|
||||
{
|
||||
// conversion to void
|
||||
return !thrown_type->__pointee->__is_function_p ();
|
||||
}
|
||||
|
||||
return __pbase_type_info::__pointer_catch (thrown_type, thr_obj, outer);
|
||||
}
|
||||
|
||||
bool __pointer_to_member_type_info::
|
||||
__pointer_catch (const __pbase_type_info *thr_type,
|
||||
void **thr_obj,
|
||||
unsigned outer) const
|
||||
{
|
||||
// This static cast is always valid, as our caller will have determined that
|
||||
// thr_type is really a __pointer_to_member_type_info.
|
||||
const __pointer_to_member_type_info *thrown_type =
|
||||
static_cast <const __pointer_to_member_type_info *> (thr_type);
|
||||
|
||||
if (*__context_class != *thrown_type->__context_class)
|
||||
return false; // not pointers to member of same class
|
||||
|
||||
return __pbase_type_info::__pointer_catch (thrown_type, thr_obj, outer);
|
||||
}
|
||||
|
||||
} // namespace std
|
||||
#endif
|
||||
|
||||
// Entry points for the compiler.
|
||||
|
||||
/* Low level match routine used by compiler to match types of catch
|
||||
variables and thrown objects. */
|
||||
|
||||
extern "C" int
|
||||
__throw_type_match_rtti_2 (const void *catch_type_r, const void *throw_type_r,
|
||||
void *objptr, void **valp)
|
||||
{
|
||||
const type_info &catch_type = *(const type_info *)catch_type_r;
|
||||
const type_info &throw_type = *(const type_info *)throw_type_r;
|
||||
|
||||
*valp = objptr;
|
||||
|
||||
#if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
|
||||
// old abi
|
||||
if (catch_type == throw_type)
|
||||
return 1;
|
||||
|
||||
if (const __user_type_info *p
|
||||
= dynamic_cast <const __user_type_info *> (&throw_type))
|
||||
{
|
||||
return p->upcast (catch_type, objptr, valp);
|
||||
}
|
||||
else if (const __pointer_type_info *fr =
|
||||
dynamic_cast <const __pointer_type_info *> (&throw_type))
|
||||
{
|
||||
const __pointer_type_info *to =
|
||||
dynamic_cast <const __pointer_type_info *> (&catch_type);
|
||||
|
||||
if (! to)
|
||||
return 0;
|
||||
|
||||
const type_info *subfr = &fr->type, *subto = &to->type;
|
||||
__attr_type_info::cv cvfrom, cvto;
|
||||
|
||||
if (const __attr_type_info *at
|
||||
= dynamic_cast <const __attr_type_info *> (subfr))
|
||||
{
|
||||
cvfrom = at->attr;
|
||||
subfr = &at->type;
|
||||
}
|
||||
else
|
||||
cvfrom = __attr_type_info::NONE;
|
||||
|
||||
if (const __attr_type_info *at
|
||||
= dynamic_cast <const __attr_type_info *> (subto))
|
||||
{
|
||||
cvto = at->attr;
|
||||
subto = &at->type;
|
||||
}
|
||||
else
|
||||
cvto = __attr_type_info::NONE;
|
||||
|
||||
if (((cvfrom & __attr_type_info::CONST)
|
||||
> (cvto & __attr_type_info::CONST))
|
||||
|| ((cvfrom & __attr_type_info::VOLATILE)
|
||||
> (cvto & __attr_type_info::VOLATILE)))
|
||||
return 0;
|
||||
|
||||
if (*subto == *subfr)
|
||||
return 1;
|
||||
else if (*subto == typeid (void)
|
||||
&& dynamic_cast <const __func_type_info *> (subfr) == 0)
|
||||
return 1;
|
||||
else if (const __user_type_info *p
|
||||
= dynamic_cast <const __user_type_info *> (subfr))
|
||||
return p->upcast (*subto, objptr, valp);
|
||||
else if (const __pointer_type_info *pfr
|
||||
= dynamic_cast <const __pointer_type_info *> (subfr))
|
||||
{
|
||||
// Multi-level pointer conversion.
|
||||
|
||||
const __pointer_type_info *pto
|
||||
= dynamic_cast <const __pointer_type_info *> (subto);
|
||||
|
||||
if (! pto)
|
||||
return 0;
|
||||
|
||||
bool constp = (cvto & __attr_type_info::CONST);
|
||||
for (subto = &pto->type, subfr = &pfr->type; ;
|
||||
subto = &pto->type, subfr = &pfr->type)
|
||||
{
|
||||
if (const __attr_type_info *at
|
||||
= dynamic_cast <const __attr_type_info *> (subfr))
|
||||
{
|
||||
cvfrom = at->attr;
|
||||
subfr = &at->type;
|
||||
}
|
||||
else
|
||||
cvfrom = __attr_type_info::NONE;
|
||||
|
||||
if (const __attr_type_info *at
|
||||
= dynamic_cast <const __attr_type_info *> (subto))
|
||||
{
|
||||
cvto = at->attr;
|
||||
subto = &at->type;
|
||||
}
|
||||
else
|
||||
cvto = __attr_type_info::NONE;
|
||||
|
||||
if (((cvfrom & __attr_type_info::CONST)
|
||||
> (cvto & __attr_type_info::CONST))
|
||||
|| ((cvfrom & __attr_type_info::VOLATILE)
|
||||
> (cvto & __attr_type_info::VOLATILE)))
|
||||
return 0;
|
||||
|
||||
if (! constp
|
||||
&& (((cvfrom & __attr_type_info::CONST)
|
||||
< (cvto & __attr_type_info::CONST))
|
||||
|| ((cvfrom & __attr_type_info::VOLATILE)
|
||||
< (cvto & __attr_type_info::VOLATILE))))
|
||||
return 0;
|
||||
|
||||
if (*subto == *subfr)
|
||||
return 1;
|
||||
|
||||
pto = dynamic_cast <const __pointer_type_info *> (subto);
|
||||
pfr = dynamic_cast <const __pointer_type_info *> (subfr);
|
||||
if (! pto || ! pfr)
|
||||
return 0;
|
||||
|
||||
if (! (cvto & __attr_type_info::CONST))
|
||||
constp = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
// new abi
|
||||
|
||||
return catch_type.__do_catch (&throw_type, valp, 1);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
|
||||
/* Backward compatibility wrapper. */
|
||||
|
||||
extern "C" void*
|
||||
__throw_type_match_rtti (const void *catch_type_r, const void *throw_type_r,
|
||||
void *objptr)
|
||||
{
|
||||
void *ret;
|
||||
if (__throw_type_match_rtti_2 (catch_type_r, throw_type_r, objptr, &ret))
|
||||
return ret;
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Called from __cp_pop_exception. Is P the type_info node for a pointer
|
||||
of some kind? */
|
||||
|
||||
bool
|
||||
__is_pointer (void *p)
|
||||
{
|
||||
const type_info *t = reinterpret_cast <const type_info *>(p);
|
||||
#if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
|
||||
// old abi
|
||||
const __pointer_type_info *pt =
|
||||
dynamic_cast <const __pointer_type_info *> (t);
|
||||
return pt != 0;
|
||||
#else
|
||||
// new abi
|
||||
return t->__is_pointer_p ();
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
|
||||
// old abi
|
||||
|
||||
extern "C" void
|
||||
__rtti_ptr (void *addr, const char *n, const type_info *ti)
|
||||
{ new (addr) __pointer_type_info (n, *ti); }
|
||||
|
||||
extern "C" void
|
||||
__rtti_attr (void *addr, const char *n, int attrval, const type_info *ti)
|
||||
{
|
||||
new (addr) __attr_type_info
|
||||
(n, static_cast <__attr_type_info::cv> (attrval), *ti);
|
||||
}
|
||||
|
||||
extern "C" void
|
||||
__rtti_func (void *addr, const char *name)
|
||||
{ new (addr) __func_type_info (name); }
|
||||
|
||||
extern "C" void
|
||||
__rtti_ptmf (void *addr, const char *name)
|
||||
{ new (addr) __ptmf_type_info (name); }
|
||||
|
||||
extern "C" void
|
||||
__rtti_ptmd (void *addr, const char *name)
|
||||
{ new (addr) __ptmd_type_info (name); }
|
||||
|
||||
extern "C" void
|
||||
__rtti_array (void *addr, const char *name)
|
||||
{ new (addr) __array_type_info (name); }
|
||||
|
||||
extern "C" void *
|
||||
__dynamic_cast (const type_info& (*from)(void), const type_info& (*to)(void),
|
||||
int require_public, void *address, const type_info & (*sub)(void), void *subptr)
|
||||
{
|
||||
if (!require_public) abort();
|
||||
return static_cast <__user_type_info const &> (from ()).dyncast
|
||||
(/*boff=*/-1, to (), address, sub (), subptr);
|
||||
}
|
||||
|
||||
extern "C" void *
|
||||
__dynamic_cast_2 (const type_info& (*from)(void), const type_info& (*to)(void),
|
||||
int boff,
|
||||
void *address, const type_info & (*sub)(void), void *subptr)
|
||||
{
|
||||
return static_cast <__user_type_info const &> (from ()).dyncast
|
||||
(boff, to (), address, sub (), subptr);
|
||||
}
|
||||
|
||||
// type_info nodes and functions for the builtin types. The mangling here
|
||||
// must match the mangling in gcc/cp/rtti.c.
|
||||
|
||||
#define BUILTIN(mangled) \
|
||||
unsigned char __ti##mangled [sizeof (__builtin_type_info)] \
|
||||
__attribute__ ((aligned (__alignof__ (void *)))); \
|
||||
extern "C" const type_info &__tf##mangled (void) { \
|
||||
if ((*(void **) __ti##mangled) == 0) \
|
||||
new (__ti##mangled) __builtin_type_info (#mangled); \
|
||||
return *(type_info *)__ti##mangled; \
|
||||
}
|
||||
|
||||
BUILTIN (v); BUILTIN (x); BUILTIN (l); BUILTIN (i); BUILTIN (s); BUILTIN (b);
|
||||
BUILTIN (c); BUILTIN (w); BUILTIN (r); BUILTIN (d); BUILTIN (f);
|
||||
BUILTIN (Ui); BUILTIN (Ul); BUILTIN (Ux); BUILTIN (Us); BUILTIN (Uc);
|
||||
BUILTIN (Sc);
|
||||
|
||||
#endif
|
279
libstdc++-v3/libsupc++/vec.cc
Normal file
279
libstdc++-v3/libsupc++/vec.cc
Normal file
@ -0,0 +1,279 @@
|
||||
// new abi support -*- C++ -*-
|
||||
// Copyright (C) 2000
|
||||
// Free Software Foundation, Inc.
|
||||
// Written by Nathan Sidwell, Codesourcery LLC, <nathan@codesourcery.com>
|
||||
//
|
||||
// GNU CC 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.
|
||||
|
||||
// GNU CC 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 GNU CC; 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.
|
||||
|
||||
#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
|
||||
#include <cxxabi.h>
|
||||
#include <new>
|
||||
#include <exception>
|
||||
|
||||
// Exception handling hook, to mark current exception as not caught --
|
||||
// generally because we're about to rethrow it after some cleanup.
|
||||
extern "C" void __uncatch_exception (void);
|
||||
|
||||
namespace __cxxabiv1
|
||||
{
|
||||
|
||||
/* allocate and construct array */
|
||||
extern "C" void *
|
||||
__cxa_vec_new (size_t element_count,
|
||||
size_t element_size,
|
||||
size_t padding_size,
|
||||
void (*constructor) (void *),
|
||||
void (*destructor) (void *))
|
||||
{
|
||||
return __cxa_vec_new2 (element_count, element_size, padding_size,
|
||||
constructor, destructor,
|
||||
&operator new[], &operator delete []);
|
||||
}
|
||||
|
||||
extern "C" void *
|
||||
__cxa_vec_new2 (size_t element_count,
|
||||
size_t element_size,
|
||||
size_t padding_size,
|
||||
void (*constructor) (void *),
|
||||
void (*destructor) (void *),
|
||||
void *(*alloc) (size_t),
|
||||
void (*dealloc) (void *))
|
||||
{
|
||||
size_t size = element_count * element_size + padding_size;
|
||||
char *base = static_cast <char *> (alloc (size));
|
||||
|
||||
if (padding_size)
|
||||
{
|
||||
base += padding_size;
|
||||
reinterpret_cast <size_t *> (base)[-1] = element_count;
|
||||
}
|
||||
try
|
||||
{
|
||||
__cxa_vec_ctor (base, element_count, element_size,
|
||||
constructor, destructor);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
__uncatch_exception ();
|
||||
dealloc (base - padding_size);
|
||||
throw;
|
||||
}
|
||||
return base;
|
||||
}
|
||||
|
||||
extern "C" void *
|
||||
__cxa_vec_new3 (size_t element_count,
|
||||
size_t element_size,
|
||||
size_t padding_size,
|
||||
void (*constructor) (void *),
|
||||
void (*destructor) (void *),
|
||||
void *(*alloc) (size_t),
|
||||
void (*dealloc) (void *, size_t))
|
||||
{
|
||||
size_t size = element_count * element_size + padding_size;
|
||||
char *base = static_cast <char *> (alloc (size));
|
||||
|
||||
if (padding_size)
|
||||
{
|
||||
base += padding_size;
|
||||
reinterpret_cast <size_t *> (base)[-1] = element_count;
|
||||
}
|
||||
try
|
||||
{
|
||||
__cxa_vec_ctor (base, element_count, element_size,
|
||||
constructor, destructor);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
__uncatch_exception ();
|
||||
dealloc (base - padding_size, size);
|
||||
throw;
|
||||
}
|
||||
return base;
|
||||
}
|
||||
|
||||
/* construct array */
|
||||
extern "C" void
|
||||
__cxa_vec_ctor (void *array_address,
|
||||
size_t element_count,
|
||||
size_t element_size,
|
||||
void (*constructor) (void *),
|
||||
void (*destructor) (void *))
|
||||
{
|
||||
size_t ix = 0;
|
||||
char *ptr = static_cast <char *> (array_address);
|
||||
|
||||
try
|
||||
{
|
||||
if (constructor)
|
||||
for (; ix != element_count; ix++, ptr += element_size)
|
||||
constructor (ptr);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
__uncatch_exception ();
|
||||
__cxa_vec_dtor (array_address, ix, element_size, destructor);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/* construct an array by copying */
|
||||
|
||||
extern "C" void
|
||||
__cxa_vec_cctor (void *dest_array,
|
||||
void *src_array,
|
||||
size_t element_count,
|
||||
size_t element_size,
|
||||
void (*constructor) (void *, void *),
|
||||
void (*destructor) (void *))
|
||||
{
|
||||
size_t ix = 0;
|
||||
char *dest_ptr = static_cast <char *> (dest_array);
|
||||
char *src_ptr = static_cast <char *> (src_array);
|
||||
|
||||
try
|
||||
{
|
||||
if (constructor)
|
||||
for (; ix != element_count;
|
||||
ix++, src_ptr += element_size, dest_ptr += element_size)
|
||||
constructor (dest_ptr, src_ptr);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
__uncatch_exception ();
|
||||
__cxa_vec_dtor (dest_array, ix, element_size, destructor);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/* destruct array */
|
||||
extern "C" void
|
||||
__cxa_vec_dtor (void *array_address,
|
||||
size_t element_count,
|
||||
size_t element_size,
|
||||
void (*destructor) (void *))
|
||||
{
|
||||
if (destructor)
|
||||
{
|
||||
char *ptr = static_cast <char *> (array_address);
|
||||
size_t ix = element_count;
|
||||
bool unwinding = std::uncaught_exception ();
|
||||
|
||||
ptr += element_count * element_size;
|
||||
|
||||
try
|
||||
{
|
||||
while (ix--)
|
||||
{
|
||||
ptr -= element_size;
|
||||
destructor (ptr);
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
if (unwinding)
|
||||
// [except.ctor]/3 If a destructor called during stack unwinding
|
||||
// exits with an exception, terminate is called.
|
||||
std::terminate ();
|
||||
__uncatch_exception ();
|
||||
__cxa_vec_dtor (array_address, ix, element_size, destructor);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* destruct and release array */
|
||||
extern "C" void
|
||||
__cxa_vec_delete (void *array_address,
|
||||
size_t element_size,
|
||||
size_t padding_size,
|
||||
void (*destructor) (void *))
|
||||
{
|
||||
__cxa_vec_delete2 (array_address, element_size, padding_size,
|
||||
destructor,
|
||||
&operator delete []);
|
||||
}
|
||||
|
||||
extern "C" void
|
||||
__cxa_vec_delete2 (void *array_address,
|
||||
size_t element_size,
|
||||
size_t padding_size,
|
||||
void (*destructor) (void *),
|
||||
void (*dealloc) (void *))
|
||||
{
|
||||
char *base = static_cast <char *> (array_address);
|
||||
|
||||
if (padding_size)
|
||||
{
|
||||
size_t element_count = reinterpret_cast <size_t *> (base)[-1];
|
||||
base -= padding_size;
|
||||
try
|
||||
{
|
||||
__cxa_vec_dtor (array_address, element_count, element_size,
|
||||
destructor);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
__uncatch_exception ();
|
||||
dealloc (base);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
dealloc (base);
|
||||
}
|
||||
|
||||
extern "C" void
|
||||
__cxa_vec_delete3 (void *array_address,
|
||||
size_t element_size,
|
||||
size_t padding_size,
|
||||
void (*destructor) (void *),
|
||||
void (*dealloc) (void *, size_t))
|
||||
{
|
||||
char *base = static_cast <char *> (array_address);
|
||||
size_t size = 0;
|
||||
|
||||
if (padding_size)
|
||||
{
|
||||
size_t element_count = reinterpret_cast <size_t *> (base)[-1];
|
||||
base -= padding_size;
|
||||
size = element_count * element_size + padding_size;
|
||||
try
|
||||
{
|
||||
__cxa_vec_dtor (array_address, element_count, element_size,
|
||||
destructor);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
__uncatch_exception ();
|
||||
dealloc (base, size);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
dealloc (base, size);
|
||||
}
|
||||
|
||||
} // namespace __cxxabiv1
|
||||
|
||||
#endif // defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
|
@ -21,7 +21,7 @@
|
||||
## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
## USA.
|
||||
|
||||
## $Id: Makefile.am,v 1.32 2000/10/04 06:44:25 bkoz Exp $
|
||||
## $Id: Makefile.am,v 1.33 2000/10/05 11:36:52 bkoz Exp $
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.3 gnits
|
||||
MAINT_CHARSET = latin1
|
||||
@ -239,6 +239,7 @@ libinst_wstring_la_SOURCES = $(wstring_sources)
|
||||
|
||||
libstdc___la_LIBADD = \
|
||||
../math/libmath.la ../libio/libio.la \
|
||||
../libsupc++/libsupc++convenience.la \
|
||||
@libinst_wstring_la@
|
||||
|
||||
libstdc___la_LDFLAGS = -version-info 3:0:0 -lm
|
||||
|
@ -196,7 +196,7 @@ libstdc___la_SOURCES = $(sources)
|
||||
|
||||
libinst_wstring_la_SOURCES = $(wstring_sources)
|
||||
|
||||
libstdc___la_LIBADD = ../math/libmath.la ../libio/libio.la @libinst_wstring_la@
|
||||
libstdc___la_LIBADD = ../math/libmath.la ../libio/libio.la ../libsupc++/libsupc++convenience.la @libinst_wstring_la@
|
||||
|
||||
|
||||
libstdc___la_LDFLAGS = -version-info 3:0:0 -lm
|
||||
|
Loading…
x
Reference in New Issue
Block a user