// Newer versions of gcc have a very nice feature: you can set
// a verbose terminate handler, that not only aborts a program
// when an exception is thrown and not caught somewhere, but
// before aborting it prints that an exception has been thrown,
// and possibly what the std::exception::what() function has to
// say. Since many people run into the trap of not having a
// catch clause in main(), they wonder where that abort may be
// coming from. The terminate handler then at least says what is
// missing in their program.
git-svn-id: https://svn.dealii.org/trunk@6859
0785d39b-7218-0410-832d-
ea1e28bc413d
+dnl -------------------------------------------------------------
+dnl Newer versions of gcc have a very nice feature: you can set
+dnl a verbose terminate handler, that not only aborts a program
+dnl when an exception is thrown and not caught somewhere, but
+dnl before aborting it prints that an exception has been thrown,
+dnl and possibly what the std::exception::what() function has to
+dnl say. Since many people run into the trap of not having a
+dnl catch clause in main(), they wonder where that abort may be
+dnl coming from. The terminate handler then at least says what is
+dnl missing in their program.
+dnl
+dnl This test checks whether this feature is available.
+dnl
+dnl Usage: DEAL_II_HAVE_VERBOSE_TERMINATE
+dnl
+dnl -------------------------------------------------------------
+AC_DEFUN(DEAL_II_HAVE_VERBOSE_TERMINATE, dnl
+[
+ AC_MSG_CHECKING(for __verbose_terminate_handler)
+ AC_LANG(C++)
+ CXXFLAGS="$CXXFLAGSG"
+ AC_TRY_LINK(
+ [
+#include <exception>
+
+namespace __gnu_cxx
+{
+ extern void __verbose_terminate_handler ();
+}
+
+struct preload_terminate_dummy
+{
+ preload_terminate_dummy()
+ { std::set_terminate (__gnu_cxx::__verbose_terminate_handler); }
+};
+
+static preload_terminate_dummy dummy;
+ ],
+ [
+ throw 1;
+ ],
+ [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_VERBOSE_TERMINATE, 1,
+ [Define if the compiler provides __verbose_terminate_handler])
+ ],
+ [
+ AC_MSG_RESULT(no)
+ ])
+])
+
+
+
dnl -------------------------------------------------------------
dnl When compiling with ACE thread support, there are many constructs
dnl that are not allowed in C++, or that yield warnings when compiling with
classes (early gcc versions did not) */
#undef HAVE_STD_STRINGSTREAM
+/* Define if the compiler provides __verbose_terminate_handler */
+#undef HAVE_VERBOSE_TERMINATE
+
/* On SunOS 4.x, the getrusage() function exists, but is not declared in the
respective header file <resource.h>, as one would think when reading the
man pages. Then we have to declare this function ourselves in those files
* here to make them unconditionally available to all other parts of the
* library.
*
- * The constants defined here are a subset of the constants sometimes
- * declared in the system include file , but without the
- * prefix .
+ * The constants defined here are a subset of the @p{M_XXX} constants sometimes
+ * declared in the system include file @p{math.h}, but without the
+ * prefix @p{M_}.
*/
namespace deal_II_numbers {
/**
}
};
+
+
+// from the aclocal file:
+// Newer versions of gcc have a very nice feature: you can set
+// a verbose terminate handler, that not only aborts a program
+// when an exception is thrown and not caught somewhere, but
+// before aborting it prints that an exception has been thrown,
+// and possibly what the std::exception::what() function has to
+// say. Since many people run into the trap of not having a
+// catch clause in main(), they wonder where that abort may be
+// coming from. The terminate handler then at least says what is
+// missing in their program.
+#ifdef HAVE_VERBOSE_TERMINATE
+namespace __gnu_cxx
+{
+ extern void __verbose_terminate_handler ();
+}
+
+namespace
+{
+ struct preload_terminate_dummy
+ {
+ preload_terminate_dummy()
+ { std::set_terminate (__gnu_cxx::__verbose_terminate_handler); }
+ };
+
+ static preload_terminate_dummy dummy;
+}
+
+#endif
#! /bin/sh
-# From configure.in Revision: 1.127 .
+# From configure.in Revision: 1.128 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.57.
#
rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: checking for __verbose_terminate_handler" >&5
+echo $ECHO_N "checking for __verbose_terminate_handler... $ECHO_C" >&6
+ ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ CXXFLAGS="$CXXFLAGSG"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+#include <exception>
+
+namespace __gnu_cxx
+{
+ extern void __verbose_terminate_handler ();
+}
+
+struct preload_terminate_dummy
+{
+ preload_terminate_dummy()
+ { std::set_terminate (__gnu_cxx::__verbose_terminate_handler); }
+};
+
+static preload_terminate_dummy dummy;
+
+int
+main ()
+{
+
+ throw 1;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_VERBOSE_TERMINATE 1
+_ACEOF
+
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+
echo "$as_me:$LINENO: checking whether getrusage is properly declared" >&5
echo $ECHO_N "checking whether getrusage is properly declared... $ECHO_C" >&6
ac_ext=cc
DEAL_II_HAVE_STD_OSTREAM_HEADER
DEAL_II_HAVE_STD_IOSFWD_HEADER
DEAL_II_HAVE_BUILTIN_EXPECT
+DEAL_II_HAVE_VERBOSE_TERMINATE
DEAL_II_CHECK_GETRUSAGE
DEAL_II_CHECK_ISNAN
DEAL_II_CHECK_RAND_R
<h3>base</h3>
<ol>
+ <li> <p>
+ New: Newer versions of gcc have a very nice feature: you can set
+ a verbose terminate handler, that not only aborts a program
+ when an exception is thrown and not caught somewhere, but
+ before aborting it prints that an exception has been thrown,
+ and possibly what the std::exception::what() function has to
+ say. Since many people run into the trap of not having a
+ catch clause in main(), they wonder where that abort may be
+ coming from. The terminate handler then at least says what is
+ missing in their program.
+ <br>
+ (WB 2002/12/19)
+ </p>
+
<li> <p>
New: There is now a <code class="class">Patterns::List</code> pattern
that matches a list of elements each of which has to satisfy a pattern