natStackTrace.cc (fillInStackTrace): Throw #ifdef (HAVE_BACKTRACE) around the whole...
authorAndrew Haley <aph@redhat.com>
Thu, 5 Dec 2002 11:35:11 +0000 (11:35 +0000)
committerAndrew Haley <aph@gcc.gnu.org>
Thu, 5 Dec 2002 11:35:11 +0000 (11:35 +0000)
2002-12-05  Andrew Haley  <aph@redhat.com>

* gnu/gcj/runtime/natStackTrace.cc (fillInStackTrace): Throw
#ifdef (HAVE_BACKTRACE) around the whole function body.

From-SVN: r59855

libjava/ChangeLog
libjava/gnu/gcj/runtime/natStackTrace.cc

index 4f4a7e14aa34d23226242b1289fd483e493a91a2..34125a36ab852c77d26a29985b7afc53e8e3b62a 100644 (file)
@@ -1,3 +1,8 @@
+2002-12-05  Andrew Haley  <aph@redhat.com>
+
+       * gnu/gcj/runtime/natStackTrace.cc (fillInStackTrace): Throw
+       #ifdef (HAVE_BACKTRACE) around the whole function body.
+
 2002-12-05  Tom Tromey  <tromey@redhat.com>
 
        * java/lang/Class.h (_Jv_SetVTableEntries): Updated declaration.
index 5cd89e31a6f581a1095255d8d9b0a2b2c7b2b8e9..e977f356638e9c0838d44e69eb238da52f53fbd8 100644 (file)
@@ -44,16 +44,15 @@ details.  */
 #include <unwind.h>
 
 
-// Fill in this stack trace with N elements starting at offset.
+// Fill in this stack trace with MAXLEN elements starting at offset.
 void
 gnu::gcj::runtime::StackTrace::fillInStackTrace (jint maxlen, jint offset)
 {
-#if defined (HAVE_BACKTRACE)
+#ifdef HAVE_BACKTRACE
   offset += 1;
   void *_p[maxlen + offset];
   len = backtrace (_p, maxlen + offset) - offset;
   void **p = _p + offset;
-#endif
   _Jv_frame_info *frame;
   if (len > 0)
     {
@@ -86,6 +85,10 @@ gnu::gcj::runtime::StackTrace::fillInStackTrace (jint maxlen, jint offset)
     frame = NULL;
 
   addrs = reinterpret_cast<gnu::gcj::RawData *> (frame);
+#else // HAVE_BACKTRACE
+  (void)maxlen;
+  (void)offset;
+#endif // HAVE_BACKTRACE
 }
 
 /* Obtain the next power-of-2 of some integer.  */