This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: WIN-18: remove exception.cc dependancy on libstdc++-v3 headers
- From: Adam Megacz <patches at lists dot megacz dot com>
- To: java-patches at gcc dot gnu dot org
- Date: 11 Feb 2002 14:24:54 -0800
- Subject: Re: WIN-18: remove exception.cc dependancy on libstdc++-v3 headers
- Organization: Myself
- References: <863d08trsl.fsf@megacz.com> <87lmdzabdm.fsf@creche.redhat.com>
Tom Tromey <tromey@redhat.com> writes:
> 1. Add a comment before the `namespace std' explaining why we need this.
> This is the sort of oddity we must document in the source.
> 2. I think this should be formatted:
Cool. Committed as shown below:
- a
Index: exception.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/exception.cc,v
retrieving revision 1.18
diff -u -r1.18 exception.cc
--- exception.cc 2001/09/10 01:21:08 1.18
+++ exception.cc 2002/02/11 22:25:33
@@ -11,16 +11,25 @@
#include <config.h>
#include <stddef.h>
-#include <cstdlib>
+#include <stdlib.h>
#include <java/lang/Class.h>
#include <java/lang/NullPointerException.h>
#include <gcj/cni.h>
#include <jvm.h>
+// unwind-pe.h uses std::abort(), but sometimes we compile libjava
+// without libstdc++-v3. The following hack forces it to use
+// stdlib.h's abort().
+namespace std
+{
+ void abort ()
+ {
+ ::abort ();
+ }
+}
#include "unwind.h"
-
struct alignment_test_struct
{
char space;
@@ -97,7 +106,7 @@
recover. As is the way of such things, almost certainly we will have
crashed before now, rather than actually being able to diagnose the
problem. */
- std::abort ();
+ abort();
}
@@ -344,7 +353,7 @@
// ??? Perhaps better to make them an index into a table
// of null-terminated strings instead of playing games
// with Utf8Const+1 as above.
- std::abort ();
+ abort ();
}
if (ar_disp == 0)