exception.cc (__terminate_func): Remove declaration.
authorChris Demetriou <cgd@broadcom.com>
Wed, 24 Jan 2001 03:04:04 +0000 (03:04 +0000)
committerChris Demetriou <cgd@gcc.gnu.org>
Wed, 24 Jan 2001 03:04:04 +0000 (19:04 -0800)
2001-01-23  Chris Demetriou  <cgd@broadcom.com>

        * exception.cc (__terminate_func): Remove declaration.
        (__terminate_func_ptr): New typedef.
        (__terminate, __terminate_set_func): New extern function
        prototypes.
        (std::terminate): Use __terminate function.
        (std::set_terminate): Use __terminate_set_func function.

From-SVN: r39225

libstdc++/ChangeLog
libstdc++/exception.cc

index 1323c65ace5d181a8ea1f10207e2f1f9400b0632..9fc67ea02ca664164c9924a475fbcdd78d295e43 100644 (file)
@@ -1,3 +1,12 @@
+2001-01-23  Chris Demetriou  <cgd@broadcom.com>
+
+       * exception.cc (__terminate_func): Remove declaration.
+       (__terminate_func_ptr): New typedef.
+       (__terminate, __terminate_set_func): New extern function
+       prototypes.
+       (std::terminate): Use __terminate function.
+       (std::set_terminate): Use __terminate_set_func function.
+
 2000-11-24  Magnus Fromreide <magfr@lysator.liu.se>
 
        * sstream: Backport libstdc++-V3 sstream to V2.
index 886915c823bb5554ea93f59761ed7d5884193679..c27b8ff9603388f0bc103ccc7f94ab3f147e10ee 100644 (file)
 /* 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__));
+/* __terminate and __terminate_set_func, defined in libgcc2. */
+typedef void (*__terminate_func_ptr)(void) __attribute__ ((__noreturn__));
+extern "C" void __terminate (void) __attribute__ ((__noreturn__));
+extern "C" __terminate_func_ptr __terminate_set_func (__terminate_func_ptr);
+
 using std::terminate;
 
 void
 std::terminate ()
 {
-  __terminate_func ();
+  __terminate ();
 }
 
 void
@@ -59,10 +63,7 @@ static std::unexpected_handler __unexpected_func __attribute__((__noreturn__))
 std::terminate_handler
 std::set_terminate (std::terminate_handler func)
 {
-  std::terminate_handler old = __terminate_func;
-
-  __terminate_func = func;
-  return old;
+  return __terminate_set_func (func);
 }
 
 std::unexpected_handler