Makefile.am (sources): Add guard.cc.
authorMark Mitchell <mark@codesourcery.com>
Mon, 25 Nov 2002 23:17:31 +0000 (23:17 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Mon, 25 Nov 2002 23:17:31 +0000 (23:17 +0000)
* 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

libstdc++-v3/ChangeLog
libstdc++-v3/libsupc++/Makefile.am
libstdc++-v3/libsupc++/Makefile.in
libstdc++-v3/libsupc++/cxxabi.h
libstdc++-v3/libsupc++/guard.cc [new file with mode: 0644]

index f060b28..0aeaf55 100644 (file)
@@ -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
index 451dbc3..160e79f 100644 (file)
@@ -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 \
index 144b509..b517b45 100644 (file)
@@ -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)
index 371b77e..3132187 100644 (file)
@@ -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 (file)
index 0000000..b93cffd
--- /dev/null
@@ -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 *)
+  {
+  }
+}