aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2002-11-25 23:17:31 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2002-11-25 23:17:31 +0000
commitc4f6640537ff392ad466a83796e68fb79b512bee (patch)
tree4d7d6f3c4d6bb4f7992a62114aad66dbfef3dc40
parenta91dce31a505155e1fab4d828178e1108e8ff801 (diff)
downloadgcc-c4f6640537ff392ad466a83796e68fb79b512bee.zip
gcc-c4f6640537ff392ad466a83796e68fb79b512bee.tar.gz
gcc-c4f6640537ff392ad466a83796e68fb79b512bee.tar.bz2
Makefile.am (sources): Add guard.cc.
* libsupc++/Makefile.am (sources): Add guard.cc. * libsupc++/Makefile.in: Regenerated. * libsupc++/cxxabi.h (__cxa_guard_acquire): New function. (__cxa_guard_release): Likewise. (__cxa_guard_abort): Likewise. * libsupc++/guard.cc: New file. From-SVN: r59475
-rw-r--r--libstdc++-v3/ChangeLog9
-rw-r--r--libstdc++-v3/libsupc++/Makefile.am1
-rw-r--r--libstdc++-v3/libsupc++/Makefile.in11
-rw-r--r--libstdc++-v3/libsupc++/cxxabi.h14
-rw-r--r--libstdc++-v3/libsupc++/guard.cc51
5 files changed, 81 insertions, 5 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index f060b28..0aeaf55 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,12 @@
+2002-11-25 Mark Mitchell <mark@codesourcery.com>
+
+ * libsupc++/Makefile.am (sources): Add guard.cc.
+ * libsupc++/Makefile.in: Regenerated.
+ * libsupc++/cxxabi.h (__cxa_guard_acquire): New function.
+ (__cxa_guard_release): Likewise.
+ (__cxa_guard_abort): Likewise.
+ * libsupc++/guard.cc: New file.
+
2002-11-25 Wolfgang Bangerth <bangerth@ticam.utexas.edu>
* include/std/std_complex.h
diff --git a/libstdc++-v3/libsupc++/Makefile.am b/libstdc++-v3/libsupc++/Makefile.am
index 451dbc3..160e79f 100644
--- a/libstdc++-v3/libsupc++/Makefile.am
+++ b/libstdc++-v3/libsupc++/Makefile.am
@@ -84,6 +84,7 @@ sources = \
eh_terminate.cc \
eh_throw.cc \
eh_type.cc \
+ guard.cc \
new_handler.cc \
new_op.cc \
new_opnt.cc \
diff --git a/libstdc++-v3/libsupc++/Makefile.in b/libstdc++-v3/libsupc++/Makefile.in
index 144b509..b517b45 100644
--- a/libstdc++-v3/libsupc++/Makefile.in
+++ b/libstdc++-v3/libsupc++/Makefile.in
@@ -193,6 +193,7 @@ sources = \
eh_terminate.cc \
eh_throw.cc \
eh_type.cc \
+ guard.cc \
new_handler.cc \
new_op.cc \
new_opnt.cc \
@@ -289,15 +290,15 @@ libsupc__convenience_la_LIBADD =
libsupc__convenience_la_OBJECTS = del_op.lo del_opnt.lo del_opv.lo \
del_opvnt.lo eh_alloc.lo eh_aux_runtime.lo eh_catch.lo eh_exception.lo \
eh_globals.lo eh_personality.lo eh_terminate.lo eh_throw.lo eh_type.lo \
-new_handler.lo new_op.lo new_opnt.lo new_opv.lo new_opvnt.lo pure.lo \
-tinfo.lo tinfo2.lo vec.lo cxa_demangle.lo dyn-string.lo
+guard.lo new_handler.lo new_op.lo new_opnt.lo new_opv.lo new_opvnt.lo \
+pure.lo tinfo.lo tinfo2.lo vec.lo cxa_demangle.lo dyn-string.lo
libsupc___la_LDFLAGS =
libsupc___la_LIBADD =
libsupc___la_OBJECTS = del_op.lo del_opnt.lo del_opv.lo del_opvnt.lo \
eh_alloc.lo eh_aux_runtime.lo eh_catch.lo eh_exception.lo eh_globals.lo \
-eh_personality.lo eh_terminate.lo eh_throw.lo eh_type.lo new_handler.lo \
-new_op.lo new_opnt.lo new_opv.lo new_opvnt.lo pure.lo tinfo.lo \
-tinfo2.lo vec.lo cxa_demangle.lo dyn-string.lo
+eh_personality.lo eh_terminate.lo eh_throw.lo eh_type.lo guard.lo \
+new_handler.lo new_op.lo new_opnt.lo new_opv.lo new_opvnt.lo pure.lo \
+tinfo.lo tinfo2.lo vec.lo cxa_demangle.lo dyn-string.lo
CXXFLAGS = @CXXFLAGS@
CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
CXXLD = $(CXX)
diff --git a/libstdc++-v3/libsupc++/cxxabi.h b/libstdc++-v3/libsupc++/cxxabi.h
index 371b77e..3132187 100644
--- a/libstdc++-v3/libsupc++/cxxabi.h
+++ b/libstdc++-v3/libsupc++/cxxabi.h
@@ -500,6 +500,20 @@ void __cxa_vec_delete3 (void *__array_address,
__SIZE_TYPE__ __padding_size,
void (*__destructor) (void *),
void (*__dealloc) (void *, __SIZE_TYPE__));
+
+/* guard variables */
+
+/* The ABI requires a 64-bit type. */
+__extension__ typedef int __guard __attribute__((mode (__DI__)));
+
+extern "C"
+int __cxa_guard_acquire (__guard *);
+
+extern "C"
+void __cxa_guard_release (__guard *);
+
+extern "C"
+void __cxa_guard_abort (__guard *);
/* demangling routines */
diff --git a/libstdc++-v3/libsupc++/guard.cc b/libstdc++-v3/libsupc++/guard.cc
new file mode 100644
index 0000000..b93cffd
--- /dev/null
+++ b/libstdc++-v3/libsupc++/guard.cc
@@ -0,0 +1,51 @@
+// Copyright (C) 2002 Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// GCC 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.
+
+// GCC 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 GCC; 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.
+
+// Written by Mark Mitchell, CodeSourcery LLC, <mark@codesourcery.com>
+
+#include <cxxabi.h>
+
+namespace __cxxabiv1
+{
+ extern "C"
+ int __cxa_guard_acquire (__guard *g)
+ {
+ return !*(char *)(g);
+ }
+
+ extern "C"
+ void __cxa_guard_release (__guard *g)
+ {
+ *(char *)g = 1;
+ }
+
+ extern "C"
+ void __cxa_guard_abort (__guard *)
+ {
+ }
+}